mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-17 06:17:27 +00:00
Model change: add 1:1 link Person:User
This commit is contained in:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user