summaryrefslogtreecommitdiffstats
path: root/core/views/user_registration.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2025-01-21 11:29:20 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2025-01-21 11:29:20 +0000
commit65cdeb4994b333f2facb6ef34fe7690e33deab76 (patch)
tree3708ccca63c3ba99c09adc7dac6129b94ca9f43b /core/views/user_registration.py
parent01afb09a6e9bdc5b4b45168e63918037e0d34f0e (diff)
downloadtroggle-65cdeb4994b333f2facb6ef34fe7690e33deab76.tar.gz
troggle-65cdeb4994b333f2facb6ef34fe7690e33deab76.tar.bz2
troggle-65cdeb4994b333f2facb6ef34fe7690e33deab76.zip
Loads and resaves same file. Round trip working.
Diffstat (limited to 'core/views/user_registration.py')
-rw-r--r--core/views/user_registration.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/views/user_registration.py b/core/views/user_registration.py
index 72df989..0648a28 100644
--- a/core/views/user_registration.py
+++ b/core/views/user_registration.py
@@ -5,7 +5,7 @@ from django.core.exceptions import ValidationError
from django.contrib.auth.models import User
from troggle.core.models.troggle import DataIssue, Person
-from troggle.parsers.users import register_user
+from troggle.parsers.users import register_user, save_users
"""
This is the new individual user login registration, instead of everyone signing
@@ -32,8 +32,10 @@ def register(request, username=None):
if current_user != form_user:
print(f"## UNAUTHORIZED Password reset ## {current_user} {form_user}")
return render(request, "login/register.html", {"form": form, "unauthorized": True})
- # create User in the system and refresh stored encrypted user list and git commit it.
- register_user(un, email, password=pw, pwhash=None)
+ # create User in the system and refresh stored encrypted user list and git commit it:
+ updated_user = register_user(un, email, password=pw, pwhash=None)
+ save_users()
+ # to do, login automatically, and redirect to control panel ?
return HttpResponseRedirect("/accounts/login/")
else:
if current_user: