[Django] #30058: Consistent return values for SMTP EmailBackend.send_messages()

4 views
Skip to first unread message

Django

unread,
Dec 23, 2018, 7:35:00 AM12/23/18
to django-...@googlegroups.com
#30058: Consistent return values for SMTP EmailBackend.send_messages()
------------------------------------------+------------------------
Reporter: Denis Stebunov | Owner: nobody
Type: Uncategorized | Status: new
Component: Core (Mail) | Version: 2.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------+------------------------
In its current version, EmailBackend.send_messages() would return None if
no messages were sent due to a connection error, or a number of sent
messages otherwise.

The proposal is to return 0 instead of None so that this method always
returns an integer. As far as I can see, other built-in email backends in
Django always return an integer.

PR available: [https://github.com/django/django/pull/10784]

--
Ticket URL: <https://code.djangoproject.com/ticket/30058>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 23, 2018, 12:15:24 PM12/23/18
to django-...@googlegroups.com
#30058: Consistent return values for SMTP EmailBackend.send_messages()
--------------------------------+------------------------------------

Reporter: Denis Stebunov | Owner: nobody
Type: Bug | Status: new
Component: Core (Mail) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------
Changes (by Simon Charette):

* version: 2.1 => master
* type: Uncategorized => Bug
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/30058#comment:1>

Django

unread,
Dec 23, 2018, 12:20:33 PM12/23/18
to django-...@googlegroups.com
#30058: Consistent return values for SMTP EmailBackend.send_messages()
--------------------------------+------------------------------------

Reporter: Denis Stebunov | Owner: nobody
Type: Bug | Status: new
Component: Core (Mail) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------
Changes (by Simon Charette):

* needs_better_patch: 0 => 1


Comment:

It's missing a regression test for the `not email_messages` case.

--
Ticket URL: <https://code.djangoproject.com/ticket/30058#comment:2>

Django

unread,
Dec 25, 2018, 9:58:21 AM12/25/18
to django-...@googlegroups.com
#30058: Consistent return values for SMTP EmailBackend.send_messages()
--------------------------------+------------------------------------

Reporter: Denis Stebunov | Owner: nobody
Type: Bug | Status: new
Component: Core (Mail) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------
Changes (by Denis Stebunov):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/30058#comment:3>

Django

unread,
Dec 25, 2018, 11:06:01 AM12/25/18
to django-...@googlegroups.com
#30058: Consistent return values for SMTP EmailBackend.send_messages()
-------------------------------------+-------------------------------------

Reporter: Denis Stebunov | Owner: nobody
Type: Bug | Status: new
Component: Core (Mail) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/30058#comment:4>

Django

unread,
Dec 26, 2018, 9:55:06 AM12/26/18
to django-...@googlegroups.com
#30058: Make SMTP EmailBackend.send_messages() return 0 rather than None for
empty/error cases
-------------------------------------+-------------------------------------

Reporter: Denis Stebunov | Owner: nobody
Type: Bug | Status: new
Component: Core (Mail) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

--
Ticket URL: <https://code.djangoproject.com/ticket/30058#comment:5>

Django

unread,
Dec 26, 2018, 7:33:18 PM12/26/18
to django-...@googlegroups.com
#30058: Make SMTP EmailBackend.send_messages() return 0 rather than None for
empty/error cases
-------------------------------------+-------------------------------------
Reporter: Denis Stebunov | Owner: nobody
Type: Bug | Status: closed

Component: Core (Mail) | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"277de2298465496b58808d22f67963544c76b16a" 277de229]:
{{{
#!CommitTicketReference repository=""
revision="277de2298465496b58808d22f67963544c76b16a"
Fixed #30058 -- Made SMTP EmailBackend.send_messages() return 0 for
empty/error cases.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30058#comment:6>

Reply all
Reply to author
Forward
0 new messages