mirror of
https://github.com/wizarrrr/wizarr.git
synced 2026-07-31 07:17:10 -04:00
When the legacy AdminUser (id="admin", a string) is logged in and tries to create an API key, the string id was being passed to the Integer FK column created_by_id on ApiKey, causing a DB type mismatch error. Resolve the id by looking up the first AdminAccount row instead. Also adds a try/except with session rollback around the DB write so failures surface as a flash message rather than a 500.