-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved non-atomic logic into mixin class
- Loading branch information
1 parent
100a728
commit 9963c50
Showing
3 changed files
with
18 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from __future__ import unicode_literals | ||
|
||
from django.db import transaction | ||
from django.utils.decorators import method_decorator | ||
|
||
|
||
class NonAtomicMixin(object): | ||
""" | ||
Mixin to configure a view to be handled without a transaction | ||
""" | ||
@method_decorator(transaction.non_atomic_requests) | ||
def dispatch(self, request, *args, **kwargs): | ||
return super(NonAtomicMixin, self).dispatch(request, *args, **kwargs) |