diff --git a/mail/chief/licence_reply/processor.py b/mail/chief/licence_reply/processor.py index 8221e506..c2e7981e 100644 --- a/mail/chief/licence_reply/processor.py +++ b/mail/chief/licence_reply/processor.py @@ -55,8 +55,8 @@ def __init__(self, data: str) -> None: @classmethod def load_from_mail(cls, mail: Mail) -> "LicenceReplyProcessor": - acceptable_types = [ExtractTypeEnum.LICENCE_DATA, ExtractTypeEnum.LICENCE_REPLY] - if mail.extract_type not in acceptable_types: + # acceptable_types = [ExtractTypeEnum.LICENCE_DATA, LICENCE_REPLY] + if mail.extract_type != ExtractTypeEnum.LICENCE_DATA: raise ValueError( f"Error with Mail ({mail.id} - {mail.response_subject}): Invalid extract type {mail.extract_type}" ) diff --git a/mail/libraries/data_processors.py b/mail/libraries/data_processors.py index 87018766..012d4320 100644 --- a/mail/libraries/data_processors.py +++ b/mail/libraries/data_processors.py @@ -69,7 +69,7 @@ def serialize_email_message(dto: EmailMessageDto) -> Mail or None: # f"Unable to process file due to the following error: {error.text}. It was sent in run number {run_number}" # ) - if "Duplicate transaction reference" in _mail.response_data: + if _mail.response_data != None and "Duplicate transaction reference" in _mail.response_data: raise EdifactFileError(f"Unable to process file due to error with mail {_mail.id} the edi file was {_mail.edi_filename}")