mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 04:19:25 +00:00
Add page for clubs and inactive clubs
This commit is contained in:
@ -999,6 +999,11 @@ class Page(models.Model):
|
||||
except:
|
||||
return self.name
|
||||
|
||||
@property
|
||||
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())
|
||||
|
||||
def delete(self):
|
||||
self.unset_lock_recursive()
|
||||
self.set_lock_recursive(User.objects.get(id=0))
|
||||
|
Reference in New Issue
Block a user