mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-30 01:46:24 +01:00
Use @transaction.atomic rather than the deprecated (as of Django 1.6) commit_on_success
This commit is contained in:
parent
178a235d2d
commit
419b671fcc
@ -279,7 +279,7 @@ class Page(MP_Node, ClusterableModel, Indexed):
|
||||
|
||||
return self.url_path
|
||||
|
||||
@transaction.commit_on_success # ensure that changes are only committed when we have updated all descendant URL paths, to preserve consistency
|
||||
@transaction.atomic # ensure that changes are only committed when we have updated all descendant URL paths, to preserve consistency
|
||||
def save(self, *args, **kwargs):
|
||||
update_descendant_url_paths = False
|
||||
|
||||
@ -535,7 +535,7 @@ class Page(MP_Node, ClusterableModel, Indexed):
|
||||
"""
|
||||
return (not self.live) and (not self.get_descendants().filter(live=True).exists())
|
||||
|
||||
@transaction.commit_on_success # only commit when all descendants are properly updated
|
||||
@transaction.atomic # only commit when all descendants are properly updated
|
||||
def move(self, target, pos=None):
|
||||
"""
|
||||
Extension to the treebeard 'move' method to ensure that url_path is updated too.
|
||||
|
Loading…
Reference in New Issue
Block a user