mirror of
https://github.com/ae-utbm/sith.git
synced 2026-04-16 08:18:22 +00:00
add links to club edit page
This commit is contained in:
@@ -204,6 +204,13 @@ class Club(models.Model):
|
||||
"""Method to see if that object can be edited by the given user."""
|
||||
return self.has_rights_in_club(user)
|
||||
|
||||
def can_roles_be_edited_by(self, user: User) -> bool:
|
||||
"""Return True if the given user can edit the roles of this club"""
|
||||
return (
|
||||
user.has_perm("club.change_clubrole")
|
||||
or self.members.ongoing().filter(user=user, role__is_presidency=True).exists()
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def current_members(self) -> list[Membership]:
|
||||
return list(
|
||||
|
||||
Reference in New Issue
Block a user