Skip to content

Commit

Permalink
fix: ensure faculty is saved on user create
Browse files Browse the repository at this point in the history
  • Loading branch information
tymees committed Apr 25, 2024
1 parent 62419c7 commit 542970b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ def process_faculties(self, faculties):
if faculty_obj.users.filter(pk=self.pk).exists():
continue

# Save the user to ensure the user is saved before adding the faculty
self.save()

faculty_obj.users.add(self)
except: # noQA
logger.error(f"Error processing faculty for user", exc_info=True)
Expand Down

0 comments on commit 542970b

Please sign in to comment.