fix: grant admin role in seed_dev_data so dev-login works immediately
Previously the admin role was only granted during dev-login via ensure_admin_role(), but dev_run.sh resets the DB on each start, so the role was never present when first visiting /admin. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -308,6 +308,13 @@ def main():
|
|||||||
dev_user_id = cursor.lastrowid
|
dev_user_id = cursor.lastrowid
|
||||||
print(f" Created (id={dev_user_id})")
|
print(f" Created (id={dev_user_id})")
|
||||||
|
|
||||||
|
# Grant admin role to dev user
|
||||||
|
conn.execute(
|
||||||
|
"INSERT OR IGNORE INTO user_roles (user_id, role) VALUES (?, 'admin')",
|
||||||
|
(dev_user_id,),
|
||||||
|
)
|
||||||
|
print(" Admin role granted")
|
||||||
|
|
||||||
# 2. Seed suppliers
|
# 2. Seed suppliers
|
||||||
print(f"\nSeeding {len(SUPPLIERS)} suppliers...")
|
print(f"\nSeeding {len(SUPPLIERS)} suppliers...")
|
||||||
supplier_ids = {}
|
supplier_ids = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user