Skip to content

Commit

Permalink
Order import: Catch utf8 errors (PRETIXEU-9FP)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelm committed Dec 5, 2023
1 parent d6d6b73 commit b95da48
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/pretix/base/services/orderimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,15 @@ def import_orders(event: Event, fileid: str, settings: dict, locale: str, user,
user = User.objects.get(pk=user)
with language(locale, event.settings.region):
cols = get_all_columns(event)
parsed = parse_csv(cf.file, charset=charset)
try:
parsed = parse_csv(cf.file, charset=charset)
except UnicodeDecodeError as e:
raise DataImportError(
_(
'Error decoding special characters in your file: {message}').format(
message=str(e)
)
)
orders = []
order = None
data = []
Expand Down

0 comments on commit b95da48

Please sign in to comment.