diff --git a/club/models.py b/club/models.py index 8ee448b8..383db7f8 100644 --- a/club/models.py +++ b/club/models.py @@ -296,6 +296,9 @@ class Mailing(models.Model): def can_view(self, user): return self.club.has_rights_in_club(user) + def can_be_edited_by(self, user): + return self.club.has_rights_in_club(user) + def delete(self): for sub in self.subscriptions.all(): sub.delete() diff --git a/club/views.py b/club/views.py index 7cc4cfb7..ab0e54eb 100644 --- a/club/views.py +++ b/club/views.py @@ -509,6 +509,9 @@ class ClubMailingView(ClubTabsMixin, ListView): kwargs['has_objects'] = len(kwargs['object_list']) > 0 return kwargs + def get_object(self): + return self.club + class MailingGenericCreateView(CreateView, SingleObjectMixin): """