Unverified Commit d60f1a56 authored by IAMZn's avatar IAMZn Committed by GitHub

fix:determine multiple result exceptions caused by admin (#2211)

Co-authored-by: 's avatarchenxin <chenxin@limayao.com>
parent da83f840
...@@ -75,7 +75,7 @@ def validate_dataset_token(view=None): ...@@ -75,7 +75,7 @@ def validate_dataset_token(view=None):
tenant_account_join = db.session.query(Tenant, TenantAccountJoin) \ tenant_account_join = db.session.query(Tenant, TenantAccountJoin) \
.filter(Tenant.id == api_token.tenant_id) \ .filter(Tenant.id == api_token.tenant_id) \
.filter(TenantAccountJoin.tenant_id == Tenant.id) \ .filter(TenantAccountJoin.tenant_id == Tenant.id) \
.filter(TenantAccountJoin.role.in_(['owner', 'admin'])) \ .filter(TenantAccountJoin.role.in_(['owner'])) \
.one_or_none() .one_or_none()
if tenant_account_join: if tenant_account_join:
tenant, ta = tenant_account_join tenant, ta = 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