diff --git a/mailing_lists/views.py b/mailing_lists/views.py index bc9061644e419b1eabe1a20086a41714f0df28e4..07792fff8517e31ac61e744087daeb4fec78637b 100644 --- a/mailing_lists/views.py +++ b/mailing_lists/views.py @@ -51,7 +51,7 @@ def export_non_registered_invitations(request): Syncronize the Mailchimp lists in the database with the lists known in the mailchimp account which is related to the API_KEY. """ - invitations = RegistrationInvitation.objects.declined() + invitations = RegistrationInvitation.objects.declined_or_without_response() response = HttpResponse(content_type='text/csv') filename = "export_{timestamp}_non_registered_invitations.csv".format(timestamp='') diff --git a/scipost/managers.py b/scipost/managers.py index 788aecb9a7773c31236423938c52945692f5fc1c..3ccbe039f795d54634463f869ff292e78bbb3780 100644 --- a/scipost/managers.py +++ b/scipost/managers.py @@ -44,6 +44,9 @@ class RegistrationInvitationManager(models.Manager): def declined(self): return self.filter(responded=True, declined=True) + def declined_or_without_response(self): + return self.filter(Q(responded=True, declined=True) | Q(responded=False)) + class UnavailabilityPeriodManager(models.Manager): def today(self):