wbmailing 1.51.7__tar.gz → 1.58.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wbmailing-1.51.7 → wbmailing-1.58.1}/PKG-INFO +1 -1
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/filters/mailing_lists.py +0 -1
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/models/mailing_lists.py +3 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/models/mails.py +7 -3
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/templatetags/mailing_tags.py +1 -1
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/tests/models/test_mails.py +2 -2
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/tests/test_viewsets.py +4 -4
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/tests/tests.py +4 -4
- {wbmailing-1.51.7 → wbmailing-1.58.1}/.gitignore +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/pyproject.toml +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/__init__.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/admin.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/apps.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/backend.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/celery.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/dynamic_preferences_registry.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/factories.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/filters/__init__.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/filters/mails.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/locale/de/LC_MESSAGES/django.mo +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/locale/de/LC_MESSAGES/django.po +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/locale/de/LC_MESSAGES/django.po.translated +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/locale/en/LC_MESSAGES/django.mo +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/locale/en/LC_MESSAGES/django.po +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/locale/fr/LC_MESSAGES/django.mo +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/locale/fr/LC_MESSAGES/django.po +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/management/__init__.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/migrations/0001_initial_squashed_squashed_0008_alter_mail_bcc_email_alter_mail_cc_email_and_more.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/migrations/0002_delete_mailingsettings.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/migrations/0003_alter_mailinglistsubscriberchangerequest_options.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/migrations/__init__.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/models/__init__.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/serializers/__init__.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/serializers/mailing_lists.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/serializers/mails.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/tasks.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/templates/email_base_template.html +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/templates/mailing/maintain_mail_subsciptions.html +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/templates/mailing/manage_mailing_list_subscriptions.html +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/templates/template.html +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/templates/test.html +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/templates/workbench.html +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/templatetags/__init__.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/tests/__init__.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/tests/conftest.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/tests/models/__init__.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/tests/models/test_mailing_lists.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/tests/signals.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/tests/test_serializers.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/tests/test_tasks.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/urls.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/viewsets/__init__.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/viewsets/analytics.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/viewsets/buttons/__init__.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/viewsets/buttons/mailing_lists.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/viewsets/buttons/mails.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/viewsets/display/__init__.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/viewsets/display/mailing_lists.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/viewsets/display/mails.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/viewsets/endpoints/__init__.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/viewsets/endpoints/mailing_lists.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/viewsets/endpoints/mails.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/viewsets/mailing_lists.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/viewsets/mails.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/viewsets/menu/__init__.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/viewsets/menu/mailing_lists.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/viewsets/menu/mails.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/viewsets/titles/__init__.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/viewsets/titles/mailing_lists.py +0 -0
- {wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/viewsets/titles/mails.py +0 -0
|
@@ -68,7 +68,6 @@ class MailStatusMassMailFilterSet(wb_filters.FilterSet):
|
|
|
68
68
|
class MailingListEmailContactThroughModelModelFilterSet(wb_filters.FilterSet):
|
|
69
69
|
expiration_date = wb_filters.DateTimeRangeFilter(
|
|
70
70
|
label=_("Expiration Date"),
|
|
71
|
-
method=wb_filters.DateRangeFilter.base_date_range_filter_method,
|
|
72
71
|
)
|
|
73
72
|
is_pending_request_change = wb_filters.BooleanFilter(
|
|
74
73
|
label=_("Pending Change"), lookup_expr="exact", field_name="is_pending_request_change"
|
|
@@ -237,6 +237,9 @@ class MailingListEmailContactThroughModel(models.Model):
|
|
|
237
237
|
class Meta:
|
|
238
238
|
unique_together = ("mailing_list", "email_contact")
|
|
239
239
|
|
|
240
|
+
def __str__(self) -> str:
|
|
241
|
+
return f"{self.mailing_list} - {self.email_contact}"
|
|
242
|
+
|
|
240
243
|
def change_state(self, automatically_approve: bool = False, **kwargs):
|
|
241
244
|
"""
|
|
242
245
|
When called, change the state of the relationship from subscribe to unsubscribe or unsubscribe to subscribe
|
|
@@ -404,7 +404,8 @@ class Mail(DocumentMixin, WBModel):
|
|
|
404
404
|
)
|
|
405
405
|
|
|
406
406
|
document_type, created = DocumentType.objects.get_or_create(name="mailing")
|
|
407
|
-
for
|
|
407
|
+
for attachment in attachments:
|
|
408
|
+
name, payload = attachment[0:2]
|
|
408
409
|
# If an alternative sent from DMS is found, we match against the attachment email.
|
|
409
410
|
dms_elements = list(filter(lambda x: x["filename"] == name, dms_alternatives))
|
|
410
411
|
if (len(dms_elements) == 1) and (document_id := dms_elements[0].get("id", None)):
|
|
@@ -626,6 +627,9 @@ class MailEvent(models.Model):
|
|
|
626
627
|
verbose_name = _("Mail Event")
|
|
627
628
|
verbose_name_plural = _("Mail Events")
|
|
628
629
|
|
|
630
|
+
def __str__(self) -> str:
|
|
631
|
+
return f"{self.mail} - {self.event_type}"
|
|
632
|
+
|
|
629
633
|
@classmethod
|
|
630
634
|
def subquery_delivered_mails(cls, mass_mail_name="pk"):
|
|
631
635
|
"""
|
|
@@ -713,7 +717,7 @@ class MailTemplate(WBModel):
|
|
|
713
717
|
|
|
714
718
|
|
|
715
719
|
@receiver(tracking)
|
|
716
|
-
def handle_mail_tracking(sender, event, esp_name, **kwargs):
|
|
720
|
+
def handle_mail_tracking(sender, event, esp_name, **kwargs): # noqa: C901
|
|
717
721
|
"""
|
|
718
722
|
Signal triggered by the Sendgrid sdk. Create MailEvent
|
|
719
723
|
"""
|
|
@@ -741,7 +745,7 @@ def handle_mail_tracking(sender, event, esp_name, **kwargs):
|
|
|
741
745
|
automatically_approve=automatically_approve,
|
|
742
746
|
)
|
|
743
747
|
|
|
744
|
-
def get_mail(message_id, tags=
|
|
748
|
+
def get_mail(message_id, tags: list | None = None):
|
|
745
749
|
mail = Mail.objects.filter(message_ids__contains=[event.message_id]).first()
|
|
746
750
|
if mail:
|
|
747
751
|
return mail
|
|
@@ -163,7 +163,7 @@ class TestSpecificModels:
|
|
|
163
163
|
@override_settings(EMAIL_BACKEND="anymail.backends.test.EmailBackend", ANYMAIL_SENDGRID_API_KEY="TEST")
|
|
164
164
|
@patch("wbmailing.backend.SendgridEmailBackend._send")
|
|
165
165
|
@pytest.mark.parametrize("resend, exit_document", [(False, False), (False, True), (True, False)])
|
|
166
|
-
def
|
|
166
|
+
def test_sendgridemailbackend_send_messages(self, mock_send, resend, exit_document):
|
|
167
167
|
request = APIRequestFactory().get("")
|
|
168
168
|
request.user = get_or_create_superuser()
|
|
169
169
|
num_sent = SendgridEmailBackend().send_messages(None)
|
|
@@ -184,7 +184,7 @@ class TestSpecificModels:
|
|
|
184
184
|
msg.send()
|
|
185
185
|
|
|
186
186
|
if exit_document:
|
|
187
|
-
for name,
|
|
187
|
+
for name, _, _ in msg.attachments:
|
|
188
188
|
doc1.name = name
|
|
189
189
|
doc1.save()
|
|
190
190
|
|
|
@@ -177,8 +177,8 @@ class TestSpecificViewsets:
|
|
|
177
177
|
request = APIRequestFactory().get("")
|
|
178
178
|
request.user = user
|
|
179
179
|
factory = get_model_factory(MailingListSubscriberChangeRequestModelViewSet().get_serializer_class().Meta.model)
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
factory.create()
|
|
181
|
+
obj = factory()
|
|
182
182
|
kwargs = get_kwargs(obj, MailingListSubscriberChangeRequestModelViewSet, request)
|
|
183
183
|
assert (
|
|
184
184
|
MailingListSubscriberChangeRequest.objects.filter(
|
|
@@ -196,7 +196,7 @@ class TestSpecificViewsets:
|
|
|
196
196
|
@pytest.mark.parametrize(
|
|
197
197
|
"mvs, factory", [(ManageMailingListSubscriptions, MailingListEmailContactThroughModelFactory)]
|
|
198
198
|
)
|
|
199
|
-
def
|
|
199
|
+
def test_managemailinglistsubscriptions(self, mvs, factory, user):
|
|
200
200
|
request = APIRequestFactory().get("")
|
|
201
201
|
request.user = user
|
|
202
202
|
through_model = factory()
|
|
@@ -205,7 +205,7 @@ class TestSpecificViewsets:
|
|
|
205
205
|
assert response.content
|
|
206
206
|
|
|
207
207
|
@pytest.mark.parametrize("mvs, factory", [(UnsubscribeView, MailingListEmailContactThroughModelFactory)])
|
|
208
|
-
def
|
|
208
|
+
def test_unsubscribeview(self, mvs, factory, user):
|
|
209
209
|
request = APIRequestFactory().get("")
|
|
210
210
|
request.user = user
|
|
211
211
|
through_model = factory()
|
|
@@ -59,7 +59,7 @@ class TestSpecificAdmin:
|
|
|
59
59
|
assert len(mail.outbox) == nb_mail_send + 1
|
|
60
60
|
|
|
61
61
|
@patch("wbmailing.models.mails.send_mail_as_task.delay")
|
|
62
|
-
def
|
|
62
|
+
def test_mailadmin(self, send_mail_as_task, user):
|
|
63
63
|
request = APIRequestFactory().get("")
|
|
64
64
|
request.user = user
|
|
65
65
|
ToEmailMailFactory()
|
|
@@ -91,7 +91,7 @@ class TestSpecificAdmin:
|
|
|
91
91
|
send_mail_as_task(**msg)
|
|
92
92
|
assert len(mail.outbox) == 1
|
|
93
93
|
|
|
94
|
-
def
|
|
94
|
+
def test_stripandsplit(self):
|
|
95
95
|
string = "diego loic is the best man"
|
|
96
96
|
result = stripAndsplit(string, " ")
|
|
97
97
|
assert len(result) == 6
|
|
@@ -123,8 +123,8 @@ class TestSpecificAdmin:
|
|
|
123
123
|
request = APIRequestFactory().get("")
|
|
124
124
|
request.user = user
|
|
125
125
|
factory = get_model_factory(mvs().get_serializer_class().Meta.model)
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
factory()
|
|
127
|
+
obj = factory()
|
|
128
128
|
kwargs = get_kwargs(obj, mvs, request)
|
|
129
129
|
assert (
|
|
130
130
|
MailingListSubscriberChangeRequest.objects.filter(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{wbmailing-1.51.7 → wbmailing-1.58.1}/wbmailing/templates/mailing/maintain_mail_subsciptions.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|