def _get_email(self): # If the email was missing previously, then we don't want subsequent # events to re-add it, so we'll just skip them. if self._email_message.missing: return db = object_session(self._email_message) email = (db.query(EmailAddress).filter( EmailAddress.email == self._email_message.to).first()) # If our email is None, then we'll mark our log so that when we're # viewing the log, we can tell that it wasn't recorded. if email is None: self._email_message.missing = True return email
def _get_email(self): # If the email was missing previously, then we don't want subsequent # events to re-add it, so we'll just skip them. if self._email_message.missing: return db = object_session(self._email_message) email = (db.query(EmailAddress) .filter(EmailAddress.email == self._email_message.to) .first()) # If our email is None, then we'll mark our log so that when we're # viewing the log, we can tell that it wasn't recorded. if email is None: self._email_message.missing = True return email
def _get_email(self): db = object_session(self._email_message) return (db.query(EmailAddress) .filter(EmailAddress.email == self._email_message.to) .one())