Permalink
Browse files

Use transaction.commit_on_success as a decorator.

Django 1.2 does not support using transaction.commit_on_success as a
context manager, so we'll use it as a decorator.
  • Loading branch information...
1 parent 5c708ba commit d7681de823aafe5b41b808209af9bc457549ef4a @joshbohde joshbohde committed Jun 8, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 tastypie/resources.py
View
@@ -1975,15 +1975,15 @@ def obj_delete(self, request=None, **kwargs):
obj.delete()
+ @transaction.commit_on_success()
def patch_list(self, request, **kwargs):
"""
An ORM-specific implementation of ``patch_list``.
Necessary because PATCH should be atomic (all-success or all-fail)
and the only way to do this neatly is at the database level.
"""
- with transaction.commit_on_success():
- return super(ModelResource, self).patch_list(request, **kwargs)
+ return super(ModelResource, self).patch_list(request, **kwargs)
def rollback(self, bundles):
"""

0 comments on commit d7681de

Please sign in to comment.