chore: instance admin passowrd change

This commit is contained in:
NarayanBavisetti 2023-11-23 13:07:42 +05:30
parent 784be47e91
commit 827a00c1d3

View File

@ -45,7 +45,7 @@ class Command(BaseCommand):
# If the user does not exist create the user and add him to the database # If the user does not exist create the user and add him to the database
if user is None: if user is None:
user = User.objects.create(email=admin_email, username=uuid.uuid4().hex) user = User.objects.create(email=admin_email, username=uuid.uuid4().hex)
user.set_password(uuid.uuid4().hex) user.set_password(admin_email)
user.save() user.save()
license_engine_base_url = os.environ.get("LICENSE_ENGINE_BASE_URL") license_engine_base_url = os.environ.get("LICENSE_ENGINE_BASE_URL")
@ -88,13 +88,11 @@ class Command(BaseCommand):
self.stdout.write( self.stdout.write(
self.style.SUCCESS( self.style.SUCCESS(
f"Instance succesfully registered with owner: {instance.primary_owner.email}" f"Instance successfully registered with owner: {instance.primary_owner.email}"
) )
) )
return return
raise CommandError("Instance could not be registered")
self.stdout.write(self.style.WARNING("Instance could not be registered"))
return
else: else:
self.stdout.write( self.stdout.write(
self.style.SUCCESS( self.style.SUCCESS(