Skip to content

Commit

Permalink
Fix issue with no superuser settings
Browse files Browse the repository at this point in the history
  • Loading branch information
FinemechanicPub committed Aug 12, 2024
1 parent f48690f commit dca73bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions backend/app/core/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional
from typing import Literal
from pydantic import EmailStr
from pydantic_settings import BaseSettings, SettingsConfigDict

Expand All @@ -8,9 +8,9 @@ class Settings(BaseSettings):

app_title: str = "Puzzle game"
connection_string: str = "sqlite+aiosqlite://"
secret: str = "SECRET"
first_superuser_email: Optional[EmailStr] = None
first_superuser_password: Optional[str] = None
secret: str = "SECRET2"
first_superuser_email: EmailStr | Literal[""] = ""
first_superuser_password: str = ""
unverified_user_can_login: bool = True
max_cells: int = 120
page_limit: int = 20
Expand Down
4 changes: 2 additions & 2 deletions backend/app/core/init_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ async def create_user(

async def create_first_superuser():
if (
settings.first_superuser_email is not None
and settings.first_superuser_password is not None
settings.first_superuser_email
and settings.first_superuser_password
):
await create_user(
email=settings.first_superuser_email,
Expand Down

0 comments on commit dca73bb

Please sign in to comment.