summaryrefslogtreecommitdiffstats
path: root/parsers/users.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2025-01-21 19:18:17 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2025-01-21 19:18:17 +0000
commitc5357cab3d79cd177c277b968a311eef3dde302b (patch)
tree4d773da2eb48b639a686e2b54a03012e4bbe4ad9 /parsers/users.py
parenta784ca86410d573c627d2173f16b30d139e79900 (diff)
downloadtroggle-c5357cab3d79cd177c277b968a311eef3dde302b.tar.gz
troggle-c5357cab3d79cd177c277b968a311eef3dde302b.tar.bz2
troggle-c5357cab3d79cd177c277b968a311eef3dde302b.zip
Model change: add 1:1 link Person:User
Diffstat (limited to 'parsers/users.py')
-rw-r--r--parsers/users.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/parsers/users.py b/parsers/users.py
index 29009cf..fe11bdf 100644
--- a/parsers/users.py
+++ b/parsers/users.py
@@ -8,7 +8,7 @@ from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
-from troggle.core.models.troggle import DataIssue
+from troggle.core.models.troggle import DataIssue, Person
"""This imports the registered troggle users, who are nearly-all, but not quite, Persons.
exceptions are "expo" and "expoadmin" which are created by the databaseReset.py import program.
@@ -45,7 +45,13 @@ def register_user(u, email, password=None, pwhash=None):
print(f" - receated and reset user '{user}'")
except Exception as e:
print(f"Exception <{e}>\n{len(User.objects.all())} users now in db:\n{User.objects.all()}")
- raise
+ raise
+
+ expoers = Person.objects.filter(slug=u)
+ if len(expoers) == 1:
+ person = expoers[0]
+ person.user = user
+ person.save()
return user
def get_encryptor():