Files
dify/api/controllers/console
Yansong Zhang a4cb47d6cd fix: resolve DetachedInstanceError on Google OAuth login
When account_integrates has no record, the email fallback path used
sessionmaker(db.engine).begin() which auto-commits on exit, expiring
all attributes on the Account object. Subsequent access to account.id
in get_join_tenants raises DetachedInstanceError.

Remove the independent session wrapper and let
get_account_by_email_with_case_fallback use db.session (request-scoped)
so the returned Account stays attached.

Cherry-picked from bcd738d2e6 on main (#34904).

Made-with: Cursor
2026-04-17 10:40:01 +08:00
..
2026-03-11 18:29:53 +08:00
2026-03-11 18:29:53 +08:00
2026-03-11 18:29:53 +08:00
2026-01-23 21:07:52 +09:00