fix(demo_data): set default passwords for staff and superuser in demo data
Ensure default passwords are assigned to demo users for consistent behavior during testing and development.
This commit is contained in:
parent
ad5e8dc335
commit
72a54de707
1 changed files with 4 additions and 0 deletions
|
|
@ -104,6 +104,8 @@ class Command(BaseCommand):
|
||||||
is_active=True,
|
is_active=True,
|
||||||
is_verified=True,
|
is_verified=True,
|
||||||
)
|
)
|
||||||
|
if _:
|
||||||
|
user.set_password("Staff!Demo888")
|
||||||
if not user.groups.filter(name="E-Commerce Admin").exists():
|
if not user.groups.filter(name="E-Commerce Admin").exists():
|
||||||
user.groups.add(Group.objects.get(name="E-Commerce Admin"))
|
user.groups.add(Group.objects.get(name="E-Commerce Admin"))
|
||||||
return user
|
return user
|
||||||
|
|
@ -120,6 +122,8 @@ class Command(BaseCommand):
|
||||||
is_active=True,
|
is_active=True,
|
||||||
is_verified=True,
|
is_verified=True,
|
||||||
)
|
)
|
||||||
|
if _:
|
||||||
|
user.set_password("Super!Demo888")
|
||||||
return user
|
return user
|
||||||
|
|
||||||
def _load_demo_data(self) -> None:
|
def _load_demo_data(self) -> None:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue