From 0c65917d3ca930b2877848c3020b28ecccc9176f Mon Sep 17 00:00:00 2001 From: Zachary Harpaz <61989294+zachHarpaz@users.noreply.github.com> Date: Mon, 18 Nov 2024 23:36:10 -0500 Subject: [PATCH] Add Models Path --- backend/user/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/user/models.py b/backend/user/models.py index 0be70d26..638b9943 100644 --- a/backend/user/models.py +++ b/backend/user/models.py @@ -48,4 +48,5 @@ def create_or_update_user_profile(sender, instance, created, **kwargs): object exists for that User, it will create one """ Profile.objects.get_or_create(user=instance) - NotificationService.objects.get(name="COURSES").enabled_users.add(instance) + if courses_service := NotificationService.objects.filter(name="COURSES").first(): + courses_service.enabled_users.add(instance)