diff --git a/backend/api/apps.py b/backend/api/apps.py index 55a607c6..878e7d54 100644 --- a/backend/api/apps.py +++ b/backend/api/apps.py @@ -4,9 +4,3 @@ class ApiConfig(AppConfig): default_auto_field = "django.db.models.BigAutoField" name = "api" - - def ready(self): - from authentication.signals import user_created - from api.signals import user_creation - - user_created.connect(user_creation) diff --git a/backend/api/signals.py b/backend/api/signals.py index f6e2ddc5..fec0206a 100644 --- a/backend/api/signals.py +++ b/backend/api/signals.py @@ -1,9 +1,11 @@ from api.models.student import Student from authentication.models import User +from authentication.signals import user_created from django.dispatch import Signal, receiver # TODO: Is this a signal? +@receiver(user_created) def user_creation(user: User, attributes: dict, **_): """Upon user creation, auto-populate additional properties""" student_id: str = attributes.get("ugentStudentID")