mirror of
https://github.com/DRYTRIX/TimeTracker.git
synced 2026-05-19 21:00:15 -05:00
0a8fbd8329
ClientApprovalStatus is defined with uppercase Python names and lowercase string values (PENDING = "pending", etc.), but the Postgres enum type clientapprovalstatus is defined with the lowercase values. SQLAlchemy defaults to binding the enum *name*, so every query against the column sent "PENDING" and Postgres rejected it with InvalidTextRepresentation. This made get_pending_approvals_for_client raise on every client portal request — the navbar context processor catches the exception and returns 0, but the stack trace was logged on every page load. Pass values_callable to SQLEnum so SQLAlchemy uses the enum *value* (the lowercase string PG actually stores). The auto-lint hook reformatted the rest of the file; the only behavioral change is the values_callable parameter on the status column.