Fixed control flow bug that creates instances of all models after creating a user or superuser
This commit is contained in:
parent
b72129d627
commit
3a7f0a43c5
|
@ -58,10 +58,12 @@ class Command(BaseCommand):
|
||||||
email = options["register"][0]
|
email = options["register"][0]
|
||||||
password = options["register"][1]
|
password = options["register"][1]
|
||||||
self.create_user(email, password)
|
self.create_user(email, password)
|
||||||
|
any_option_used = True
|
||||||
if options["register_superuser"]:
|
if options["register_superuser"]:
|
||||||
email = options["register_superuser"][0]
|
email = options["register_superuser"][0]
|
||||||
password = options["register_superuser"][1]
|
password = options["register_superuser"][1]
|
||||||
self.create_superuser(email, password)
|
self.create_superuser(email, password)
|
||||||
|
any_option_used = True
|
||||||
|
|
||||||
if options["amount"]:
|
if options["amount"]:
|
||||||
self.create_all(options["amount"])
|
self.create_all(options["amount"])
|
||||||
|
|
Loading…
Reference in a new issue