Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix return type of message without a preferred body
The `get_body(...)` call (and hence the nominal return of the `get_body_part(...)` method) returns a email.message.EmailMessage. So if there is no body return an empty such class instead of a string, because the callers expects that it behaves like a message. E.g.: File "alot/db/utils.py", line 499, in extract_body_part **{'field_key': 'view'} if body_part.get_content_type() == 'text/plain' ^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'get_content_type'
- Loading branch information