From 9ecc736c30bcf1fdebcade6b130efe8277877fd5 Mon Sep 17 00:00:00 2001 From: Bowen Liang Date: Fri, 23 Feb 2024 10:51:19 +0800 Subject: [PATCH] fix: update current tenant id of account when switching tenant (#2530) --- api/services/account_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/services/account_service.py b/api/services/account_service.py index 17999c9e25..e35d325ae4 100644 --- a/api/services/account_service.py +++ b/api/services/account_service.py @@ -282,9 +282,9 @@ class TenantService: else: TenantAccountJoin.query.filter(TenantAccountJoin.account_id == account.id, TenantAccountJoin.tenant_id != tenant_id).update({'current': False}) tenant_account_join.current = True - db.session.commit() # Set the current tenant for the account account.current_tenant_id = tenant_account_join.tenant_id + db.session.commit() @staticmethod def get_tenant_members(tenant: Tenant) -> list[Account]: