Fixed control flow bug that creates instances of all models after creating a user or superuser

This commit is contained in:
Elijah 2023-12-22 11:13:35 +01:00
parent b72129d627
commit 3a7f0a43c5
1 changed files with 2 additions and 0 deletions

View File

@ -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"])