fix: commit default campaign claim in ensure_admin_exists, surface setup errors to user
All checks were successful
Build and Push / build (push) Successful in 12m37s

This commit is contained in:
KansaiGaijin
2026-07-30 14:35:02 +12:00
parent d25682397d
commit 24fd6f16d2
2 changed files with 24 additions and 10 deletions

View File

@@ -102,7 +102,8 @@ def ensure_admin_exists():
# Claim the "default" campaign for the admin so setup wizard works
admin = db.get_user_by_username(ADMIN_USERNAME)
if admin:
conn.execute(
"UPDATE campaigns SET created_by = ? WHERE id = 'default' AND created_by IS NULL",
(admin["id"],),
)
with db.tx():
conn.execute(
"UPDATE campaigns SET created_by = ? WHERE id = 'default' AND created_by IS NULL",
(admin["id"],),
)