Skip to content

Commit

Permalink
Bugfix return error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
valdergallo committed Dec 1, 2014
1 parent 6f2525d commit c19044d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions data_importer/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ def form_valid(self, form, owner=None):
file_history, _ = FileHistory.objects.get_or_create(file_upload=form.cleaned_data['file_upload'], owner=owner, content_type=content_type)

if not self.is_task or not hasattr(self.task, 'delay'):
self.task.run(importer=self.importer, source=file_history, owner=owner)
self.task.run(importer=self.importer,
source=file_history,
owner=owner,
send_email=False)
if self.task.parser.errors:
messages.error(self.request, self.task.importer.errors)
messages.error(self.request, self.task.parser.errors)
else:
messages.success(self.request, "File uploaded successfully")
else:
Expand Down

0 comments on commit c19044d

Please sign in to comment.