Skip to content

Commit

Permalink
revert breaking changes!
Browse files Browse the repository at this point in the history
  • Loading branch information
Kakadus committed Nov 13, 2023
1 parent 1fd0a17 commit fd04517
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion evap/staff/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import codecs
import csv
import itertools
from collections import OrderedDict, defaultdict, namedtuple
Expand Down Expand Up @@ -2130,6 +2129,7 @@ def user_export(request):
writer.writerows(
(user.title, user.last_name, user.first_name, user.email) for user in UserProfile.objects.iterator()
)
return response


@manager_required
Expand Down
4 changes: 2 additions & 2 deletions tools/enrollment_preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def run_preprocessor(enrollment_data: str | BytesIO, user_data: TextIO) -> Bytes
fix_user(users, UserCells(*wb_row[7:]))
wb_out = BytesIO()
workbook.save(wb_out)
wb.seek(0)
wb_out.seek(0)
return wb_out


Expand All @@ -83,7 +83,7 @@ def run_preprocessor(enrollment_data: str | BytesIO, user_data: TextIO) -> Bytes
parser.add_argument("user-data", help="Path to a csv file containing an export of all existing users.")
parser.add_argument("enrollment-data", help="Path to the enrollment data in xlsx format for import.")
ns = parser.parse_args()
with open(ns.user_data) as csvfile:
with open(ns.user_data, encoding="utf-8") as csvfile:
wb = run_preprocessor(ns.enrollment_data, csvfile)
with open(ns.enrollment_data, "wb") as out:
out.write(wb.read())

0 comments on commit fd04517

Please sign in to comment.