Commit 7e87a528 authored by crazywoola's avatar crazywoola

resolve comments

parent a4516143
......@@ -257,8 +257,8 @@ class TenantService:
def switch_tenant(account: Account, tenant_id: int = None) -> None:
"""Switch the current workspace for the account"""
TenantAccountJoin.query.filter_by(account_id=account.id).update({'current': False})
tenant_account_join = TenantAccountJoin.query.filter_by(account_id=account.id, tenant_id=tenant_id).first()
TenantAccountJoin.query.filter_by(account_id=account.id).update({'current': False})
# Check if the tenant exists and the account is a member of the tenant
if not tenant_account_join:
......
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