minor fix: fix dissolve tenant check permission always failed (#22292)

This commit is contained in:
NeatGuyCoding 2025-07-21 11:20:05 +08:00 committed by GitHub
parent 383a79772c
commit cbc3474bbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -1070,8 +1070,8 @@ class TenantService:
@staticmethod
def dissolve_tenant(tenant: Tenant, operator: Account) -> None:
"""Dissolve tenant"""
if not TenantService.check_member_permission(tenant, operator, operator, "remove"):
raise NoPermissionError("No permission to dissolve tenant.")
TenantService.check_member_permission(tenant, operator, None, "remove")
db.session.query(TenantAccountJoin).filter_by(tenant_id=tenant.id).delete()
db.session.delete(tenant)
db.session.commit()