add links to club edit page

This commit is contained in:
imperosol
2026-04-16 00:05:58 +02:00
parent c5513528da
commit 3ea452cc95
3 changed files with 29 additions and 2 deletions

View File

@@ -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(