mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 06:03:20 +00:00
club: fix mailing list form that unexpectedly relied on try catch in permissions
This commit is contained in:
parent
fe9164bfef
commit
811809895e
@ -641,7 +641,7 @@ class MailingFormTest(TestCase):
|
||||
{"action": MailingForm.ACTION_NEW_MAILING, "mailing_email": "mde"},
|
||||
)
|
||||
mde = Mailing.objects.get(email="mde")
|
||||
response = self.client.post(
|
||||
self.client.post(
|
||||
reverse("club:mailing", kwargs={"club_id": self.bdf.id}),
|
||||
{
|
||||
"action": MailingForm.ACTION_NEW_SUBSCRIPTION,
|
||||
@ -650,6 +650,11 @@ class MailingFormTest(TestCase):
|
||||
"subscription_mailing": mde.id,
|
||||
},
|
||||
)
|
||||
|
||||
response = self.client.get(
|
||||
reverse("club:mailing", kwargs={"club_id": self.bdf.id})
|
||||
)
|
||||
|
||||
self.assertContains(response, "comunity@git.an")
|
||||
self.assertContains(response, "richard@git.an")
|
||||
self.assertContains(response, "krophil@git.an")
|
||||
|
@ -574,7 +574,8 @@ class ClubMailingView(ClubTabsMixin, CanEditMixin, DetailFormView):
|
||||
except ValidationError as validation_error:
|
||||
return validation_error
|
||||
|
||||
users_to_save.append(sub.save())
|
||||
sub.save()
|
||||
users_to_save.append(sub)
|
||||
|
||||
if cleaned_data["subscription_email"]:
|
||||
sub = MailingSubscription(
|
||||
|
Loading…
Reference in New Issue
Block a user