Skip to content

Commit

Permalink
fixup: improve clarity.
Browse files Browse the repository at this point in the history
  • Loading branch information
elcct committed Feb 5, 2025
1 parent c7a22e9 commit 361c45f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions datahub/interaction/email_processors/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ def _extract_and_validate_contacts(self, all_recipients):
return contacts

def _extract_and_validate_sender_adviser(self):
# .from_ may come as [] or [('', '')] when missing.
if not any(from_[0] or from_[1] for from_ in self.message.from_):
if not self.message.from_ or self.message.from_ == [('', '')]:
raise MalformedEmailError('Email was malformed - missing "from" header.')
sender_email = self.message.from_[0][1]
if not was_email_sent_by_dit(self.message):
Expand Down

0 comments on commit 361c45f

Please sign in to comment.