Skip to content

Commit

Permalink
Error message did not show filename.
Browse files Browse the repository at this point in the history
The argument for the error message was "e" not the name of file to be imported.
As a result the message did not show any file name.
  • Loading branch information
carlosp420 committed Feb 15, 2016
1 parent a207f57 commit 85017cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion import_export/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def import_action(self, request, *args, **kwargs):
except UnicodeDecodeError as e:
return HttpResponse(_(u"<h1>Imported file has a wrong encoding: %s</h1>" % e))
except Exception as e:
return HttpResponse(_(u"<h1>%s encountred while trying to read file: %s</h1>" % (type(e).__name__, e)))
return HttpResponse(_(u"<h1>%s encountred while trying to read file: %s</h1>" % (type(e).__name__, import_file.name)))
result = resource.import_data(dataset, dry_run=True,
raise_errors=False,
file_name=import_file.name,
Expand Down

0 comments on commit 85017cb

Please sign in to comment.