fix: Windows path handling, light theme default, file viewer in editor, first-user admin logic
FlowDeck CI / test (push) Failing after 18s
FlowDeck CI / docker (push) Has been skipped

Config:
- Fixed SQLite path parsing on Windows (handle drive letters without prepending /)
- Changed default theme from dark to light
- Updated OAuth test credentials (gitea_oauth_client_id/secret)

Auth:
- First real user (excluding default admin with no password) becomes admin
- Changed user count query to exclude users without password_hash

File viewer:
- Removed separate _render_file_viewer() —
This commit is contained in:
2026-07-17 20:38:39 -04:00
parent 84a126cfd1
commit 6f1eabf91d
16 changed files with 712 additions and 840 deletions
+5 -3
View File
@@ -153,9 +153,11 @@ async def register(request: Request):
if existing:
from fastapi.responses import JSONResponse
return JSONResponse({"error": "Account already exists"}, status_code=409)
# First user is admin
user_count = conn.execute("SELECT COUNT(*) FROM users").fetchone()[0]
is_admin = 1 if user_count == 0 else 0
# First real user (excluding default admin with no password) is admin
real_user_count = conn.execute(
"SELECT COUNT(*) FROM users WHERE password_hash IS NOT NULL AND password_hash != ''"
).fetchone()[0]
is_admin = 1 if real_user_count == 0 else 0
conn.execute(
"INSERT INTO users (login, full_name, email, password_hash, is_admin) VALUES (?, ?, ?, ?, ?)",
(email, name, email, hash_password(password), is_admin),