Fix admin seed had no password

This commit is contained in:
Esa Kataja
2025-05-10 11:01:20 +03:00
parent 4a4eda09d1
commit 055dd3b43b
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -10,3 +10,6 @@ services:
volumes: volumes:
- ./data:/app/data - ./data:/app/data
restart: unless-stopped restart: unless-stopped
environment:
- ADMIN_USERNAME=admin
- ADMIN_PASSWORD=password
+1 -1
View File
@@ -60,7 +60,7 @@ def seed_db() -> None:
# Seed Admin users # Seed Admin users
admin_username = os.getenv("ADMIN_USERNAME") admin_username = os.getenv("ADMIN_USERNAME")
hashed_admin_password = hash_password(os.getenv("ADMIN_PASSWORD")) hashed_admin_password = hash_password(os.getenv("ADMIN_PASSWORD", "password"))
with get_connection() as conn: with get_connection() as conn:
conn.execute( conn.execute(
'INSERT INTO "User" (username, hashed_password, team_id, is_active, is_admin) VALUES (?, ?, ?, ?, ?)', 'INSERT INTO "User" (username, hashed_password, team_id, is_active, is_admin) VALUES (?, ?, ?, ?, ?)',