Commit 4128f80c authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch 'cherry-pick-0805173b' into 'release/1.12'

Merge branch 'fix/562-newsletter-old-is_active' into 'master'

See merge request !682
parents e3d9392c c6e37f7f
......@@ -8,6 +8,7 @@ from django.test import TestCase
from django.urls import reverse
from django.utils import timezone
from members.models import Membership, Profile
from newsletters.models import Newsletter, NewsletterEvent
from newsletters.templatetags import listutil
......@@ -28,6 +29,13 @@ class NewslettersTest(TestCase):
email='jacob@test.com',
password='top_secret',
is_staff=True)
Profile.objects.create(user=cls.user,
address_street='street',
address_postal_code='1234AB',
address_city='city')
Membership.objects.create(type=Membership.MEMBER,
user=cls.user,
since=timezone.now())
cls.user.user_permissions.set(
Permission.objects.filter(content_type__app_label="newsletters")
......
......@@ -69,10 +69,10 @@ def admin_send(request, pk):
translation.activate(language[0])
recipients = [member.email for member in
Member.objects.all().filter(
Member.active_members.all().filter(
profile__receive_newsletter=True,
profile__language=language[0])
if member.is_active() is True and member.email]
if member.email]
subject = '[THALIA] ' + newsletter.title
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment