Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Adrián Ribao
Cartero
Commits
7aa87bb5
Commit
7aa87bb5
authored
Sep 07, 2016
by
Adrián Ribao
Browse files
don't send to excluded emails
parent
9317f457
Pipeline
#243
passed with stage
in 44 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
cartero/utils/sending.py
View file @
7aa87bb5
...
...
@@ -15,7 +15,7 @@ from django.core.signing import Signer
from
django.core.urlresolvers
import
reverse
from
django.template
import
Template
,
Context
from
cartero.models
import
ShortURL
,
MailTracks
from
cartero.models
import
ShortURL
,
MailTracks
,
ExcludedEmail
class
CampaignDeliver
(
object
):
...
...
@@ -135,7 +135,10 @@ class CampaignDeliver(object):
return
msg
def
get_contacts
(
self
,
testing
=
False
):
contacts
=
self
.
contact_list
.
contacts
.
all
()
excluded_emails
=
ExcludedEmail
.
objects
.
all
()
\
.
values_list
(
'email'
,
flat
=
True
)
contacts
=
self
.
contact_list
.
contacts
.
exclude
(
email__in
=
excluded_emails
)
if
testing
:
contacts
=
contacts
.
filter
(
testing
=
True
)
return
contacts
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment