Fix for mailing lists

This commit is contained in:
Antoine Bartuccio 2017-12-22 12:06:23 +01:00
parent 10dfb2c122
commit b7483513be
Signed by: klmp200
GPG Key ID: E7245548C53F904B
2 changed files with 6 additions and 0 deletions

View File

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

View File

@ -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):
"""