Fix abnormal user invitaion message. (#4081)

### What problem does this PR solve?

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu 2024-12-18 12:45:24 +08:00 committed by GitHub
parent f8c9ec4d56
commit f8cef73244
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -62,8 +62,10 @@ def create(tenant_id):
user_id = usrs[0].id
user_tenants = UserTenantService.query(user_id=user_id, tenant_id=tenant_id)
if user_tenants:
if user_tenants[0].status == UserTenantRole.NORMAL.value:
if user_tenants[0].role == UserTenantRole.NORMAL:
return get_data_error_result(message="This user is in the team already.")
if user_tenants[0].role == UserTenantRole.OWNER:
return get_data_error_result(message="This user is the owner of the team.")
return get_data_error_result(message="Invitation notification is sent.")
UserTenantService.save(