mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-09 22:38:19 +02:00
Improve documentation and flake8
This commit is contained in:
parent
88e17ea684
commit
6dcded0e75
4 changed files with 13 additions and 13 deletions
|
|
@ -300,7 +300,7 @@ class Mailbox(models.Model):
|
|||
new = EmailMessage()
|
||||
if (
|
||||
msg.is_multipart()
|
||||
and not 'attachment' in msg.get('Content-Disposition', '')
|
||||
and 'attachment' not in msg.get('Content-Disposition', '')
|
||||
):
|
||||
for header, value in msg.items():
|
||||
new[header] = value
|
||||
|
|
@ -647,20 +647,18 @@ class Message(models.Model):
|
|||
return addresses
|
||||
|
||||
def reply(self, message):
|
||||
"""Sends a message as a reply to this message instance.
|
||||
|
||||
Although Django's e-mail processing will set both Message-ID
|
||||
and Date upon generating the e-mail message, we will not be able
|
||||
to retrieve that information through normal channels, so we must
|
||||
pre-set it.
|
||||
|
||||
For conveninence, you can use django.core.mail.EmailMessage to build a Message instance::
|
||||
"""Sends an EmailMessage as a reply to this message instance::
|
||||
|
||||
from django.core.mail import EmailMessage
|
||||
|
||||
message.reply(
|
||||
EmailMessage(subject="pong", body="pongpong")
|
||||
)
|
||||
|
||||
Although Django's e-mail processing will set both Message-ID
|
||||
and Date upon generating the e-mail message, we will not be able
|
||||
to retrieve that information through normal channels, so we must
|
||||
pre-set it.
|
||||
"""
|
||||
from django.core.mail import EmailMessage as DjangoEmailMessage
|
||||
|
||||
|
|
@ -900,7 +898,6 @@ class MessageAttachment(models.Model):
|
|||
return f'{self.get_filename()}: {self.document.url}'
|
||||
return self.get_filename()
|
||||
|
||||
|
||||
class Meta:
|
||||
verbose_name = _('Message attachment')
|
||||
verbose_name_plural = _('Message attachments')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue