Skip to content

Commit

Permalink
Formatting with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
ShotaTanemura authored and ShotaTanemura committed Jul 24, 2024
1 parent a793339 commit 5e8af7d
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions pong/create_superuser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,22 @@
import django
from django.contrib.auth import get_user_model

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
django.setup()

User = get_user_model()

superuser_name = os.environ.get('DJANGO_SUPERUSER_USERNAME')
superuser_password = os.environ.get('DJANGO_SUPERUSER_PASSWORD')
superuser_email = os.environ.get('DJANGO_SUPERUSER_EMAIL')
superuser_name = os.environ.get("DJANGO_SUPERUSER_USERNAME")
superuser_password = os.environ.get("DJANGO_SUPERUSER_PASSWORD")
superuser_email = os.environ.get("DJANGO_SUPERUSER_EMAIL")

if superuser_name and superuser_password:
if not User.objects.filter(name=superuser_name).exists():
print(f'Creating superuser {superuser_name}')
print(f"Creating superuser {superuser_name}")
User.objects.create_superuser(
name=superuser_name,
email=superuser_email,
password=superuser_password
name=superuser_name, email=superuser_email, password=superuser_password
)
else:
print(f'Superuser {superuser_name} already exists')
print(f"Superuser {superuser_name} already exists")
else:
print('Superuser credentials not provided')
print("Superuser credentials not provided")

0 comments on commit 5e8af7d

Please sign in to comment.