Files
TimeTracker/app/models
MacJediWizard 0a8fbd8329 fix(approvals): bind ClientApprovalStatus enum values to PG, not names
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.
2026-05-06 01:14:53 -04:00
..