Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
88586314
Kaydet (Commit)
88586314
authored
Kas 10, 2016
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #27469 -- Prevented sending email to empty addresses
Thanks Jarek Glowacki for the report.
üst
ac0cf97c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
message.py
django/core/mail/message.py
+1
-1
tests.py
tests/mail/tests.py
+16
-0
No files found.
django/core/mail/message.py
Dosyayı görüntüle @
88586314
...
...
@@ -328,7 +328,7 @@ class EmailMessage(object):
Returns a list of all recipients of the email (includes direct
addressees as well as Cc and Bcc entries).
"""
return
self
.
to
+
self
.
cc
+
self
.
bcc
return
[
email
for
email
in
(
self
.
to
+
self
.
cc
+
self
.
bcc
)
if
email
]
def
send
(
self
,
fail_silently
=
False
):
"""Sends the email message."""
...
...
tests/mail/tests.py
Dosyayı görüntüle @
88586314
...
...
@@ -100,6 +100,22 @@ class MailTests(HeadersCheckMixin, SimpleTestCase):
self
.
assertEqual
(
message
[
'From'
],
'from@example.com'
)
self
.
assertEqual
(
message
[
'To'
],
'to@example.com, other@example.com'
)
def
test_recipients_with_empty_strings
(
self
):
"""
Empty strings in various recipient arguments are always stripped
off the final recipient list.
"""
email
=
EmailMessage
(
'Subject'
,
'Content'
,
'from@example.com'
,
[
'to@example.com'
,
''
],
cc
=
[
'cc@example.com'
,
''
],
bcc
=
[
''
,
'bcc@example.com'
],
reply_to
=
[
''
,
None
],
)
self
.
assertEqual
(
email
.
recipients
(),
[
'to@example.com'
,
'cc@example.com'
,
'bcc@example.com'
]
)
def
test_cc
(
self
):
"""Regression test for #7722"""
email
=
EmailMessage
(
'Subject'
,
'Content'
,
'from@example.com'
,
[
'to@example.com'
],
cc
=
[
'cc@example.com'
])
...
...
Write
Preview
Markdown
is supported
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