make installer user use the new block_dasboard_login property
This commit is contained in:
parent
1253e9e465
commit
67fbc9ad33
|
@ -15,4 +15,5 @@ class Command(BaseCommand):
|
|||
username=uuid.uuid4().hex,
|
||||
is_installer_user=True,
|
||||
password=User.objects.make_random_password(60), # type: ignore
|
||||
block_dashboard_login=True
|
||||
)
|
||||
|
|
|
@ -2,6 +2,7 @@ from django.core.management.base import BaseCommand
|
|||
|
||||
from logs.models import PendingAction
|
||||
from scripts.models import Script
|
||||
from accounts.models import User
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
|
@ -13,3 +14,9 @@ class Command(BaseCommand):
|
|||
|
||||
# load community scripts into the db
|
||||
Script.load_community_scripts()
|
||||
|
||||
# make sure installer user is set to block_dashboard_logins
|
||||
if User.objects.filter(is_installer_user=True).exists():
|
||||
for user in User.objects.filter(is_installer_user=True):
|
||||
user.block_dashboard_login = True
|
||||
user.save()
|
||||
|
|
Loading…
Reference in New Issue