Skip to content

Commit

Permalink
update error msg when import group members (#5708)
Browse files Browse the repository at this point in the history
show email info in error msg
  • Loading branch information
imwhatiam authored Oct 25, 2023
1 parent a206b51 commit 4f384d3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions seahub/api2/endpoints/group_members.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,8 @@ def post(self, request, group_id):

for email in emails_list:

email_from_excel = email

user_not_found = False

try:
Expand All @@ -473,15 +475,15 @@ def post(self, request, group_id):
except User.DoesNotExist:
user_not_found = True

email_name = email2nickname(email)
if user_not_found:
result['failed'].append({
'email': email,
'email_name': email_name,
'error_msg': 'User %s not found.' % email_name
'email': email_from_excel,
'email_name': email2nickname(email_from_excel),
'error_msg': 'User %s not found.' % email2nickname(email_from_excel)
})
continue

email_name = email2nickname(email)
if is_group_member(group_id, email, in_structure=False):
result['failed'].append({
'email': email,
Expand Down

0 comments on commit 4f384d3

Please sign in to comment.