-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception 'str' object has no attribute 'from_email' when calling Message.reply() #285
Comments
Hi @joshpark23, |
Hey @pfouque appreciate the reply -- I wasn't passing an instance of Depending on any backwards compatibility requirements, adding type hints (>= python 3.5) could be helpful. |
I like typing, but I'm not sure we are ready to do that. Maybe adding a good old parameter check would have been enough.
|
Could someone provide me with a working example? I fail to get it to work:
I tried with |
Hi @enaut, Have you tried with Django's EmailMessage?
|
Thank you! Sometimes I miss the obvious! VsCode did not suggest that import, so I was not aware it might exist… |
It means it wasn't obvious enough! ;) |
Adding this: #293 |
Issue description
When calling the
reply()
method on aMessage
instance, an exception is thrown with the message "'str' object has no attribute 'from_email'".Proposed solution
Lines 658-662 in models.py, update implementation to avoid accessing the property not found on the Message model.
https://github.com/coddingtonbear/django-mailbox/blob/f4a0782d3df6fb54ce474448050764cc28b64ecd/django_mailbox/models.py#L658C1-L659C1
Note
This property is found on the mailbox model but not the message, not sure why it's being accessed here. Happy to raise the PR
The text was updated successfully, but these errors were encountered: