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

Co-authored-by: chenxin <chenxin@limayao.com>
This commit is contained in:
IAMZn 2024-01-26 00:06:23 +08:00 committed by GitHub
parent da83f8403e
commit d60f1a5601
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -75,7 +75,7 @@ def validate_dataset_token(view=None):
tenant_account_join = db.session.query(Tenant, TenantAccountJoin) \
.filter(Tenant.id == api_token.tenant_id) \
.filter(TenantAccountJoin.tenant_id == Tenant.id) \
.filter(TenantAccountJoin.role.in_(['owner', 'admin'])) \
.filter(TenantAccountJoin.role.in_(['owner'])) \
.one_or_none()
if tenant_account_join:
tenant, ta = tenant_account_join