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