From 351b98f1e80d6c43f7c4c864b9447f39faf48c5e Mon Sep 17 00:00:00 2001 From: eric-intuitem <71850047+eric-intuitem@users.noreply.github.com> Date: Sun, 5 Jan 2025 00:22:46 +0100 Subject: [PATCH] create superuser after library creations (#1310) --- backend/core/startup.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/core/startup.py b/backend/core/startup.py index c3f53c59a..02c931c70 100644 --- a/backend/core/startup.py +++ b/backend/core/startup.py @@ -589,6 +589,14 @@ def startup(sender: AppConfig, **kwargs): ) third_party_respondent.permissions.set(third_party_respondent_permissions) + # Create default Qualifications + try: + Qualification.create_default_qualifications() + except Exception as e: + logger.error("Error creating default qualifications", exc_info=e) + + call_command("storelibraries") + # if superuser defined and does not exist, then create it if ( CISO_ASSISTANT_SUPERUSER_EMAIL @@ -601,14 +609,6 @@ def startup(sender: AppConfig, **kwargs): except Exception as e: logger.error("Error creating superuser", exc_info=e) - # Create default Qualifications - try: - Qualification.create_default_qualifications() - except Exception as e: - logger.error("Error creating default qualifications", exc_info=e) - - call_command("storelibraries") - class CoreConfig(AppConfig): default_auto_field = "django.db.models.BigAutoField"