Dries Peeters
4e8b42ad56
Fix SQLAlchemy session attachment errors in client portal tests
...
Replace db.session.refresh() with User.query.get() to query for user
objects fresh in the current session context. This prevents 'Object is
already attached to session X (this is Y)' errors that occur when the
user fixture object from one session is used in different session
contexts, particularly when making requests through the test client.
Fixes 8 failing tests:
- test_get_client_portal_data_with_invoices
- test_get_client_portal_data_with_time_entries
- test_client_portal_dashboard_with_access
- test_client_portal_projects_route
- test_client_portal_invoices_route
- test_client_portal_time_entries_route
- test_view_invoice_belongs_to_client
- test_admin_can_disable_client_portal
2025-11-18 12:49:01 +01:00
..
2025-11-12 08:15:04 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 13:52:56 +01:00
2025-11-14 13:52:56 +01:00
2025-11-14 21:34:33 +01:00
2025-11-14 12:08:50 +01:00
2025-10-29 18:17:04 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-10-30 07:47:58 +01:00
2025-10-31 17:26:32 +01:00
2025-11-13 11:47:48 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 13:09:57 +01:00
2025-11-14 13:09:57 +01:00
2025-11-14 13:09:57 +01:00
2025-11-14 13:09:57 +01:00
2025-11-14 13:09:57 +01:00
2025-11-12 11:20:37 +01:00
2025-11-14 13:09:57 +01:00
2025-11-14 13:09:57 +01:00
2025-11-14 13:09:57 +01:00
2025-11-14 13:09:57 +01:00
2025-11-14 13:09:57 +01:00
2025-11-14 19:19:36 +01:00
2025-11-14 13:09:57 +01:00
2025-11-14 13:09:57 +01:00
2025-11-14 13:09:57 +01:00
2025-11-14 13:09:57 +01:00
2025-11-14 13:09:57 +01:00
2025-11-14 13:09:57 +01:00
2025-11-14 13:09:57 +01:00
2025-11-14 13:09:57 +01:00
2025-11-14 13:09:57 +01:00
2025-11-14 12:08:50 +01:00
2025-11-13 08:08:48 +01:00
2025-11-13 08:08:48 +01:00
2025-11-14 12:08:50 +01:00
2025-11-13 08:08:48 +01:00
2025-11-14 12:08:50 +01:00
2025-11-01 08:44:02 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-11-18 12:49:01 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 20:01:34 +01:00
2025-11-14 12:08:50 +01:00
2025-11-05 13:58:38 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-11-01 10:26:45 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 13:40:00 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-10-29 18:42:10 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-11-05 13:58:38 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-10-31 19:24:47 +01:00
2025-11-12 08:15:04 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 13:09:57 +01:00
2025-11-14 12:08:50 +01:00
2025-11-13 12:05:35 +01:00
2025-10-29 18:17:04 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-11-14 12:08:50 +01:00
2025-10-29 15:03:01 +01:00
2025-10-30 07:47:58 +01:00
2025-11-14 12:08:50 +01:00