Opened 7 years ago
Closed 7 years ago
#30058 closed Bug (fixed)
Make SMTP EmailBackend.send_messages() return 0 rather than None for empty/error cases
| Reported by: | Denis Stebunov | Owned by: | nobody |
|---|---|---|---|
| Component: | Core (Mail) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
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
Change History (6)
comment:1 by , 7 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|---|
| Type: | Uncategorized → Bug |
| Version: | 2.1 → master |
comment:2 by , 7 years ago
| Patch needs improvement: | set |
|---|
comment:3 by , 7 years ago
| Patch needs improvement: | unset |
|---|
comment:4 by , 7 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
comment:5 by , 7 years ago
| Summary: | Consistent return values for SMTP EmailBackend.send_messages() → Make SMTP EmailBackend.send_messages() return 0 rather than None for empty/error cases |
|---|
Note:
See TracTickets
for help on using tickets.
It's missing a regression test for the
not email_messagescase.