dify/api/controllers
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
..
common refactor: move workflow package to dify_graph (#32844) 2026-03-02 18:42:30 +08:00
console fix: resolve DetachedInstanceError on Google OAuth login 2026-04-17 10:40:01 +08:00
files refactor: file saver decouple db engine and ssrf proxy (#33076) 2026-03-09 16:09:44 +08:00
inner_api feat: add inner API endpoints for admin DSL import/export (#34059) 2026-03-25 19:48:53 +08:00
mcp refactor: replace remaining sa.String with EnumText 2 (#33448) 2026-03-14 20:20:30 +09:00
service_api refactor: select in console datasets document controller (#34029) 2026-03-25 12:47:25 +09:00
trigger fix: clarify webhook debug endpoint behavior (#33597) 2026-03-18 14:28:33 +08:00
web refactor: migrate db.session.query to select in inner_api and web controllers (#33774) 2026-03-20 03:32:03 +09:00
__init__.py chore(api/controllers): Apply Ruff Formatter. (#7645) 2024-08-26 15:29:10 +08:00
fastopenapi.py feat: init fastopenapi (#30453) 2026-01-23 21:07:52 +09:00