[Django] #22407: AdminEmailHandler should allow overriding the mail part of emit

15 views
Skip to first unread message

Django

unread,
Apr 8, 2014, 6:11:48 AM4/8/14
to django-...@googlegroups.com
#22407: AdminEmailHandler should allow overriding the mail part of emit
-----------------------------------------+--------------------
Reporter: Keryn Knight <django@…> | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Mail) | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------------+--------------------
Imagine I want, for some subset of errors, to instead mail ... well,
anyone but the `ADMINS`, at the moment, this is difficult because
subclassing `AdminEmailHandler` to replace the `mail.mail_admins` part
also means copying the entire `emit` method. It would be useful if a
method could be used instead, like so:

{{{
class MyAdminEmailHandler(AdminEmailHandler):
def send_mail(self, **kwargs):
mail.mail_who_I_say(connection=self.connection(), **kwargs)
}}}

With the original implementation changing such that instead of `emit()`
calling `mail.mail_admins` it instead calls
`self.send_mail(subject=subject, message=message,
html_message=html_message)`

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

Django

unread,
Apr 9, 2014, 7:47:31 AM4/9/14
to django-...@googlegroups.com
#22407: AdminEmailHandler should allow overriding the mail part of emit
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: nobody
<django@…> | Status: new
Type: | Version: master
Cleanup/optimization | Resolution:
Component: Utilities | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by timo):

* needs_better_patch: => 0
* needs_docs: => 0
* component: Core (Mail) => Utilities
* needs_tests: => 0
* stage: Unreviewed => Accepted


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

Django

unread,
Nov 10, 2014, 4:24:23 PM11/10/14
to django-...@googlegroups.com
#22407: AdminEmailHandler should allow overriding the mail part of emit
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: nobody
<django@…> | Status: new
Type: | Version: master
Cleanup/optimization | Resolution:
Component: Utilities | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0

Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by berkerpeksag):

* has_patch: 0 => 1


Comment:

https://github.com/django/django/pull/3495

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

Django

unread,
Nov 14, 2014, 9:50:24 AM11/14/14
to django-...@googlegroups.com
#22407: AdminEmailHandler should allow overriding the mail part of emit
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: nobody
<django@…> | Status: new
Type: | Version: master
Cleanup/optimization | Resolution:
Component: Utilities | Triage Stage: Ready for
Severity: Normal | checkin
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Accepted => Ready for checkin


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

Django

unread,
Nov 15, 2014, 3:39:57 AM11/15/14
to django-...@googlegroups.com
#22407: AdminEmailHandler should allow overriding the mail part of emit
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: nobody
<django@…> | Status: closed
Type: | Version: master
Cleanup/optimization | Resolution: fixed

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

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


Comment:

In [changeset:"d552da1f8d42b7c6db992fee42bc4781f5fdde43"]:
{{{
#!CommitTicketReference repository=""
revision="d552da1f8d42b7c6db992fee42bc4781f5fdde43"
Fixed #22407 -- Added AdminEmailHandler.send_mail().
}}}

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

Reply all
Reply to author
Forward
0 new messages