Skip to content

Commit

Permalink
chore: move signal
Browse files Browse the repository at this point in the history
  • Loading branch information
Topvennie committed Apr 8, 2024
1 parent 06a0a1e commit d34a9b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 0 additions & 6 deletions backend/api/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 2 additions & 0 deletions backend/api/signals.py
Original file line number Diff line number Diff line change
@@ -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")
Expand Down

0 comments on commit d34a9b9

Please sign in to comment.