Transactiontask (#268)

* Introduce TransactionAwareTask

As described in
https://blog.hypertrack.io/2016/10/08/dealing-with-database-transactions-in-django-celery/

* Use TransactionAwareTask instead of countdown

… to prevent race conditions when using a newly created object in a
task.
This commit is contained in:
Tobias Kunze
2016-10-10 16:38:06 +02:00
committed by Raphael Michel
parent 6c5cd56af7
commit 9db333bf80
4 changed files with 37 additions and 6 deletions

View File

@@ -337,7 +337,7 @@ class ImportView(EventPermissionRequiredMixin, ListView):
'event': self.request.event.pk,
'job': job.pk,
'data': parsed
}, countdown=1)
})
return redirect(reverse('plugins:banktransfer:import.job', kwargs={
'event': self.request.event.slug,
'organizer': self.request.event.organizer.slug,