forked from mirror/django-mailbox
Add minimal type check
This commit is contained in:
parent
f4a0782d3d
commit
bb924f1f4d
1 changed files with 3 additions and 0 deletions
|
|
@ -655,6 +655,9 @@ class Message(models.Model):
|
||||||
pre-set it.
|
pre-set it.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
if not isinstance(message, EmailMessage):
|
||||||
|
raise ValueError('Message must be an instance of EmailMessage')
|
||||||
|
|
||||||
if not message.from_email:
|
if not message.from_email:
|
||||||
if self.mailbox.from_email:
|
if self.mailbox.from_email:
|
||||||
message.from_email = self.mailbox.from_email
|
message.from_email = self.mailbox.from_email
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue