diff --git a/archivist/apps/authentication/views.py b/archivist/apps/authentication/views.py index bfcd065..931d66c 100644 --- a/archivist/apps/authentication/views.py +++ b/archivist/apps/authentication/views.py @@ -1,6 +1,10 @@ # Create your views here. from django.shortcuts import render, redirect from django.contrib.auth import authenticate, login + +#from django.contrib.auth.models import User +from apps.user.models import UserProfile + from .forms import LoginForm, SignUpForm @@ -41,6 +45,12 @@ def register_user(request): username = form.cleaned_data.get("username") raw_password = form.cleaned_data.get("password1") user = authenticate(username=username, password=raw_password) + + #user = User.objects.create_user(username=username, password=raw_password) + + # Create a UserProfile instance for the user + profile = UserProfile(user=user) + profile.save() msg = 'User created - please login.' success = True