Fix admin seed had no password
This commit is contained in:
@@ -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
@@ -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 (?, ?, ?, ?, ?)',
|
||||||
|
|||||||
Reference in New Issue
Block a user