mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-19 22:41:00 +00: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
1 changed files with 2 additions and 2 deletions
|
|
@ -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 a new issue