Verified Commit e2078a8c authored by Sli's avatar Sli
Browse files

Sync club pages with club tree

parent 939146bd
......@@ -116,6 +116,8 @@ class Club(models.Model):
if public:
p.view_groups.add(public)
p.save()
if self.parent and self.parent.page:
p.parent = self.parent.page
self.page = p
self.save()
elif self.page and self.page.name != self.unix_name:
......@@ -123,6 +125,11 @@ class Club(models.Model):
self.page.set_lock(root)
self.page.name = self.unix_name
self.page.save()
elif self.page and self.parent and self.parent.page and self.page.parent != self.parent.page:
self.page.unset_lock()
self.page.set_lock(root)
self.page.parent = self.parent.page
self.page.save()
def save(self, *args, **kwargs):
with transaction.atomic():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment