Skip to content

Commit

Permalink
v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Chacoon3 committed Nov 29, 2023
1 parent e611c74 commit 81d7786
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bmgt435_elp/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,8 @@ def import_users(request: HttpRequest, semester_id) -> HttpResponse:
obj_set = [BMGTUser(semester = semester, **row)
for row in user_csv.to_dict('records')]

BMGTUser.objects.bulk_create(obj_set)
resp.resolve(len(obj_set))
created_set = BMGTUser.objects.bulk_create(obj_set)
resp.resolve(f"Imported {len(created_set)} users!")
else:
resp.reject("Import failed! Please upload a CSV file that contains the following columns: user_first_name, user_last_name, directory_id")
except IntegrityError:
Expand Down

0 comments on commit 81d7786

Please sign in to comment.