Skip to content

Commit

Permalink
Fix abnormal user invitaion message. (infiniflow#4081)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
  • Loading branch information
KevinHuSh authored and learnerLj committed Dec 19, 2024
1 parent 3ccd69e commit 024b2b5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/apps/tenant_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 024b2b5

Please sign in to comment.