Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Switched the admin to use @transaction.atomic.

  • Loading branch information...
commit 3710a918b25311e5ce2f7f16f28ff2e2b8f7a12a 1 parent 55a9be8
Aymeric Augustin authored March 11, 2013
6  django/contrib/admin/options.py
@@ -986,7 +986,7 @@ def response_action(self, request, queryset):
986 986
             return None
987 987
 
988 988
     @csrf_protect_m
989  
-    @transaction.commit_on_success
  989
+    @transaction.atomic
990 990
     def add_view(self, request, form_url='', extra_context=None):
991 991
         "The 'add' admin view for this model."
992 992
         model = self.model
@@ -1073,7 +1073,7 @@ def add_view(self, request, form_url='', extra_context=None):
1073 1073
         return self.render_change_form(request, context, form_url=form_url, add=True)
1074 1074
 
1075 1075
     @csrf_protect_m
1076  
-    @transaction.commit_on_success
  1076
+    @transaction.atomic
1077 1077
     def change_view(self, request, object_id, form_url='', extra_context=None):
1078 1078
         "The 'change' admin view for this model."
1079 1079
         model = self.model
@@ -1318,7 +1318,7 @@ def changelist_view(self, request, extra_context=None):
1318 1318
         ], context, current_app=self.admin_site.name)
1319 1319
 
1320 1320
     @csrf_protect_m
1321  
-    @transaction.commit_on_success
  1321
+    @transaction.atomic
1322 1322
     def delete_view(self, request, object_id, extra_context=None):
1323 1323
         "The 'delete' admin view for this model."
1324 1324
         opts = self.model._meta
2  django/contrib/auth/admin.py
@@ -85,7 +85,7 @@ def get_urls(self):
85 85
 
86 86
     @sensitive_post_parameters()
87 87
     @csrf_protect_m
88  
-    @transaction.commit_on_success
  88
+    @transaction.atomic
89 89
     def add_view(self, request, form_url='', extra_context=None):
90 90
         # It's an error for a user to have add permission but NOT change
91 91
         # permission for users. If we allowed such users to add users, they

0 notes on commit 3710a91

Please sign in to comment.
Something went wrong with that request. Please try again.