Skip to content

Commit

Permalink
add trans for org admin add user
Browse files Browse the repository at this point in the history
  • Loading branch information
imwhatiam committed Dec 16, 2023
1 parent 5c3b048 commit 0d75c75
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions seahub/organizations/api/admin/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,11 +803,12 @@ def post(self, request, org_id):
org_members_quota = OrgMemberQuota.objects.get_quota(request.user.org.org_id)
if org_members_quota is not None and \
org_members + len(email_list) > org_members_quota:
err_msg = f'Failed. You can only invite {org_members_quota} members.'
err_msg = _(f'Failed. You can only invite {org_members_quota} members.')
return api_error(status.HTTP_403_FORBIDDEN, err_msg)

if user_number_over_limit(len(email_list)):
return api_error(status.HTTP_403_FORBIDDEN, 'The number of users exceeds the limit')
err_msg = _('The number of users exceeds the limit')
return api_error(status.HTTP_403_FORBIDDEN, err_msg)

username = request.user.username
quota_total = seafile_api.get_org_quota(org_id)
Expand All @@ -823,7 +824,7 @@ def post(self, request, org_id):
User.objects.get(email=email)
result['failed'].append({
'email': email,
'error_msg': f'User {email} already exists.'
'error_msg': _(f'User {email} already exists.')
})
continue
except User.DoesNotExist:
Expand Down

0 comments on commit 0d75c75

Please sign in to comment.