Skip to content

Commit

Permalink
Added constant VALID_PO_NUMBER_CHARACTERS
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrineyev committed Feb 11, 2025
1 parent 11e08fe commit c3c5f5c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@


class CompositeOrderMapper(MappingFileMapperBase):
VALID_PO_NUMBER_CHARACTERS = r"[A-Za-z0-9]"

def __init__(
self,
folio_client: FolioClient,
Expand Down Expand Up @@ -383,8 +385,7 @@ def validate_po_number(
index_or_id: str,
po_number: str,
):
sanitized_po = re.sub(r"[^A-Za-z0-9]", "", po_number)
if po_number != sanitized_po:
if re.sub(self.VALID_PO_NUMBER_CHARACTERS, "", po_number):
self.migration_report.add(
"PurchaseOrderVendorLinking",
i18n.t("RECORD FAILED: PO number has invalid character(s)"),
Expand Down

0 comments on commit c3c5f5c

Please sign in to comment.