Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Switched the admin to use @transaction.atomic.

  • Loading branch information...
commit 3710a918b25311e5ce2f7f16f28ff2e2b8f7a12a 1 parent 55a9be8
Aymeric Augustin aaugustin authored
Showing with 4 additions and 4 deletions.
  1. +3 −3 django/contrib/admin/options.py
  2. +1 −1  django/contrib/auth/admin.py
6 django/contrib/admin/options.py
View
@@ -986,7 +986,7 @@ def response_action(self, request, queryset):
return None
@csrf_protect_m
- @transaction.commit_on_success
+ @transaction.atomic
def add_view(self, request, form_url='', extra_context=None):
"The 'add' admin view for this model."
model = self.model
@@ -1073,7 +1073,7 @@ def add_view(self, request, form_url='', extra_context=None):
return self.render_change_form(request, context, form_url=form_url, add=True)
@csrf_protect_m
- @transaction.commit_on_success
+ @transaction.atomic
def change_view(self, request, object_id, form_url='', extra_context=None):
"The 'change' admin view for this model."
model = self.model
@@ -1318,7 +1318,7 @@ def changelist_view(self, request, extra_context=None):
], context, current_app=self.admin_site.name)
@csrf_protect_m
- @transaction.commit_on_success
+ @transaction.atomic
def delete_view(self, request, object_id, extra_context=None):
"The 'delete' admin view for this model."
opts = self.model._meta
2  django/contrib/auth/admin.py
View
@@ -85,7 +85,7 @@ def get_urls(self):
@sensitive_post_parameters()
@csrf_protect_m
- @transaction.commit_on_success
+ @transaction.atomic
def add_view(self, request, form_url='', extra_context=None):
# It's an error for a user to have add permission but NOT change
# permission for users. If we allowed such users to add users, they
Please sign in to comment.
Something went wrong with that request. Please try again.