(self, msg)
| 487 | msg.set_content(body, subtype=self.content_subtype, charset=encoding) |
| 488 | |
| 489 | def _add_attachments(self, msg): |
| 490 | if self.attachments: |
| 491 | if hasattr(self, "mixed_subtype"): |
| 492 | # RemovedInDjango70Warning. |
| 493 | raise AttributeError( |
| 494 | "EmailMessage no longer supports the" |
| 495 | " undocumented `mixed_subtype` attribute" |
| 496 | ) |
| 497 | msg.make_mixed() |
| 498 | for attachment in self.attachments: |
| 499 | if isinstance(attachment, email.message.MIMEPart): |
| 500 | msg.attach(attachment) |
| 501 | elif isinstance(attachment, MIMEBase): |
| 502 | # RemovedInDjango70Warning. |
| 503 | msg.attach(attachment) |
| 504 | else: |
| 505 | self._add_attachment(msg, *attachment) |
| 506 | |
| 507 | def _add_attachment(self, msg, filename, content, mimetype): |
| 508 | encoding = self.encoding or settings.DEFAULT_CHARSET |
no test coverage detected