Opened 11 years ago
Closed 10 years ago
#22407 closed Cleanup/optimization (fixed)
AdminEmailHandler should allow overriding the mail part of emit
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Utilities | 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 |
Pull Requests: | |||
Description ¶
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)
Change History (4)
comment:1 by , 11 years ago
Component: | Core (Mail) → Utilities |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 10 years ago
Has patch: | set |
---|
comment:3 by , 10 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:4 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
https://github.com/django/django/pull/3495