Bug: create_workspace in dashboard.py set uid=1 when session was invalid, but user 1 might not exist in the users table, causing sqlite3.IntegrityError: FOREIGN KEY constraint failed (HTTP 500). Fix: ensure user row exists (INSERT OR IGNORE) before inserting workspace with FK reference, matching the pattern in workspace.py. Also: add name validation, use INSERT OR IGNORE for members.