Verified Commit 790d723d authored by Sli's avatar Sli
Browse files

Fix page creation method for clubs

parent f4bc1b14
......@@ -112,24 +112,24 @@ class Club(models.Model):
public = Group.objects.filter(id=settings.SITH_GROUP_PUBLIC_ID).first()
p = Page(name=self.unix_name)
p.parent = club_root
if public:
if self.parent and
p.parent = = p
elif and != self.unix_name:
# = self.unix_name
elif and self.parent and and !=
# =
def save(self, *args, **kwargs):
with transaction.atomic():
......@@ -1007,8 +1007,8 @@ class Page(models.Model):
def is_club_page(self):
unauthorized_parent = Page.objects.filter(name=settings.SITH_CLUB_ROOT_PAGE).first()
return unauthorized_parent is not None and (self == unauthorized_parent or unauthorized_parent in self.get_parent_list())
club_root_page = Page.objects.filter(name=settings.SITH_CLUB_ROOT_PAGE).first()
return club_root_page is not None and (self == club_root_page or club_root_page in self.get_parent_list())
def delete(self):
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