(
self, include_html=False, email_backend=None, reporter_class=None, using=None
)
| 86 | """ |
| 87 | |
| 88 | def __init__( |
| 89 | self, include_html=False, email_backend=None, reporter_class=None, using=None |
| 90 | ): |
| 91 | super().__init__() |
| 92 | |
| 93 | # RemovedInDjango70Warning: email_backend arg and connection error. |
| 94 | if email_backend: |
| 95 | if using: |
| 96 | raise ImproperlyConfigured( |
| 97 | "The 'email_backend' argument is not compatible with 'using'." |
| 98 | ) |
| 99 | if mail.mailers._is_configured: |
| 100 | raise ImproperlyConfigured( |
| 101 | "The 'email_backend' argument is not valid when " |
| 102 | "settings.MAILERS is defined." |
| 103 | ) |
| 104 | warnings.warn( |
| 105 | "The 'email_backend' argument is deprecated. Use 'using' instead.", |
| 106 | RemovedInDjango70Warning, |
| 107 | skip_file_prefixes=django_file_prefixes(), |
| 108 | ) |
| 109 | if hasattr(self, "connection"): |
| 110 | raise AttributeError( |
| 111 | "The undocumented AdminEmailHandler.connection() method is no longer " |
| 112 | "used." |
| 113 | ) |
| 114 | |
| 115 | self.include_html = include_html |
| 116 | self.email_backend = email_backend |
| 117 | self.using = using |
| 118 | self.reporter_class = import_string( |
| 119 | reporter_class or settings.DEFAULT_EXCEPTION_REPORTER |
| 120 | ) |
| 121 | |
| 122 | def emit(self, record): |
| 123 | # Early return when no email will be sent. |
nothing calls this directly
no test coverage detected