1
0
Fork 1
mirror of https://github.com/coddingtonbear/django-mailbox.git synced 2026-07-09 22:38:19 +02:00

Add minimal type check

This commit is contained in:
Pascal F 2024-04-03 11:37:21 +02:00
parent f4a0782d3d
commit bb924f1f4d
No known key found for this signature in database
GPG key ID: 3C576B538F890866

View file

@ -655,6 +655,9 @@ class Message(models.Model):
pre-set it.
"""
if not isinstance(message, EmailMessage):
raise ValueError('Message must be an instance of EmailMessage')
if not message.from_email:
if self.mailbox.from_email:
message.from_email = self.mailbox.from_email