Skip to content

Commit

Permalink
fix: handle backend crash on startup if mailer failed
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed-Hacene committed Feb 22, 2024
1 parent 3ac7b39 commit 226ac96
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions backend/core/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,12 @@ def startup():
CISO_ASSISTANT_SUPERUSER_EMAIL
and not User.objects.filter(email=CISO_ASSISTANT_SUPERUSER_EMAIL).exists()
):
User.objects.create_superuser(
email=CISO_ASSISTANT_SUPERUSER_EMAIL, is_superuser=True
)
try:
User.objects.create_superuser(
email=CISO_ASSISTANT_SUPERUSER_EMAIL, is_superuser=True
)
except Exception as e:
print(e) #NOTE: Add this exception in the logger
# if root folder does not exist, then create it
if not Folder.objects.filter(content_type=Folder.ContentType.ROOT).exists():
Folder.objects.create(
Expand Down

0 comments on commit 226ac96

Please sign in to comment.