Skip to content

Commit

Permalink
Add minimal type check
Browse files Browse the repository at this point in the history
  • Loading branch information
pfouque committed Apr 3, 2024
1 parent f4a0782 commit bb924f1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions django_mailbox/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,9 @@ def reply(self, message):
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
Expand Down

0 comments on commit bb924f1

Please sign in to comment.