Explorar el Código

Fix:Fix the bug of incorrectly gets the APIToken. (#5597)

### What problem does this PR solve?

Fix the issue where, when getting a user's APIToken, if the user is part
of another user's team, it incorrectly gets the Team owner's APIToken
instead.


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.17.1
kunyi-yang hace 8 meses
padre
commit
555c70672e
No account linked to committer's email address
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2
    2
      api/apps/system_app.py

+ 2
- 2
api/apps/system_app.py Ver fichero

@@ -201,7 +201,7 @@ def new_token():
if not tenants:
return get_data_error_result(message="Tenant not found!")

tenant_id = tenants[0].tenant_id
tenant_id = [tenant for tenant in tenants if tenant.role == 'owner'][0].tenant_id
obj = {
"tenant_id": tenant_id,
"token": generate_confirmation_token(tenant_id),
@@ -256,7 +256,7 @@ def token_list():
if not tenants:
return get_data_error_result(message="Tenant not found!")

tenant_id = tenants[0].tenant_id
tenant_id = [tenant for tenant in tenants if tenant.role == 'owner'][0].tenant_id
objs = APITokenService.query(tenant_id=tenant_id)
objs = [o.to_dict() for o in objs]
for o in objs:

Cargando…
Cancelar
Guardar