From 3a7f0a43c5987d911ef62f21a42e29e4a7cdfe6f Mon Sep 17 00:00:00 2001 From: Elijah Date: Fri, 22 Dec 2023 11:13:35 +0100 Subject: [PATCH] Fixed control flow bug that creates instances of all models after creating a user or superuser --- idhub/management/commands/create_example_data.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/idhub/management/commands/create_example_data.py b/idhub/management/commands/create_example_data.py index 89aa408..4c8b14f 100644 --- a/idhub/management/commands/create_example_data.py +++ b/idhub/management/commands/create_example_data.py @@ -58,10 +58,12 @@ class Command(BaseCommand): email = options["register"][0] password = options["register"][1] self.create_user(email, password) + any_option_used = True if options["register_superuser"]: email = options["register_superuser"][0] password = options["register_superuser"][1] self.create_superuser(email, password) + any_option_used = True if options["amount"]: self.create_all(options["amount"])