File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 7777subscribed_title = _ ("Signed up for email newsletters" )
7878unsubscribed_icon = '<i title="{}" class="material-icons" style="font-size: small;color: var(--body-quiet-color)">markunread_mailbox</i>'
7979unsubscribed_title = _ ("Unsubscribed from email newsletters" )
80-
80+ did_not_receive_icon = '<i title="{}" class="material-icons" style="font-size: small;color: var(--orange-fg)">markunread_mailbox</i>'
81+ did_not_receive_title = _ ("The recipient has not received any mailings." )
8182
8283class CrmModelAdmin (BaseModelAdmin ):
8384
@@ -386,6 +387,17 @@ def messengers(self, obj):
386387 ))
387388 def newsletters_subscriptions (obj ):
388389 if obj .massmail :
390+ if not obj .disqualified :
391+ content_type = ContentType .objects .get_for_model (obj .__class__ )
392+ id_str = str (obj .id )
393+ is_mcs = MailingOut .objects .filter (
394+ content_type = content_type ,
395+ successful_ids__regex = fr"(^|,){ id_str } (,|$)"
396+ )
397+ if not is_mcs :
398+ return mark_safe (
399+ did_not_receive_icon .format (did_not_receive_title )
400+ )
389401 return mark_safe (
390402 subscribed_icon .format (subscribed_title )
391403 )
You can’t perform that action at this time.
0 commit comments