Unverified Commit 9ecc736c authored by Bowen Liang's avatar Bowen Liang Committed by GitHub

fix: update current tenant id of account when switching tenant (#2530)

parent 6c4e6bf1
...@@ -282,9 +282,9 @@ class TenantService: ...@@ -282,9 +282,9 @@ class TenantService:
else: else:
TenantAccountJoin.query.filter(TenantAccountJoin.account_id == account.id, TenantAccountJoin.tenant_id != tenant_id).update({'current': False}) TenantAccountJoin.query.filter(TenantAccountJoin.account_id == account.id, TenantAccountJoin.tenant_id != tenant_id).update({'current': False})
tenant_account_join.current = True tenant_account_join.current = True
db.session.commit()
# Set the current tenant for the account # Set the current tenant for the account
account.current_tenant_id = tenant_account_join.tenant_id account.current_tenant_id = tenant_account_join.tenant_id
db.session.commit()
@staticmethod @staticmethod
def get_tenant_members(tenant: Tenant) -> list[Account]: def get_tenant_members(tenant: Tenant) -> list[Account]:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment