Verified Commit 939146bd authored by Sli's avatar Sli
Browse files

Sync pages with club unix_name

parent fe69cbce
......@@ -105,22 +105,24 @@ class Club(models.Model):
def make_page(self):
if not
root = User.objects.filter(username="root").first()
if not
club_root = Page.objects.filter(name=settings.SITH_CLUB_ROOT_PAGE).first()
if root and club_root:
public = Group.objects.filter(id=settings.SITH_GROUP_PUBLIC_ID).first()
office = Group.objects.filter(name=self.unix_name + settings.SITH_BOARD_SUFFIX).first()
p = Page(name=self.unix_name)
p.parent = club_root
if public:
if office:
p.edit_groups.add(office) = p
elif and != self.unix_name: = self.unix_name
def save(self, *args, **kwargs):
with transaction.atomic():
......@@ -85,6 +85,12 @@ class Command(BaseCommand):
home_root = SithFile(parent=None, name="users", is_folder=True, owner=root)
# Page needed for club creation
p = Page(name=settings.SITH_CLUB_ROOT_PAGE)
club_root = SithFile(parent=None, name="clubs", is_folder=True, owner=root)
SithFile(parent=None, name="SAS", is_folder=True, owner=root).save()
......@@ -147,10 +153,6 @@ Welcome to the wiki page!
PageRev(page=p, title="Laverie", author=root, content="Fonctionnement de la laverie").save()
p = Page(name=settings.SITH_CLUB_ROOT_PAGE)
# Here we add a lot of test datas, that are not necessary for the Sith, but that provide a basic development environment
if not options['prod']:
# Adding user Skia
......@@ -892,6 +892,12 @@ class Page(models.Model):
def can_be_edited_by(self, user):
if self.is_club_page and
# Override normal behavior for clubs
return True
return False
def get_parent_list(self):
l = []
p = self.parent
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