Skip to content

Commit f10aab1

Browse files
committed
Simplify condition in util
1 parent ab67c3d commit f10aab1

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

modules/util.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -582,12 +582,9 @@ def normalize_regional_phone_numbers(self, phone: str, region: str) -> str:
582582
return phone
583583

584584
# Fix Austrian phone number duplication issue before processing
585-
if region == "AT" and phone.startswith("+4343"):
585+
if region == "AT" and "4343" in phone:
586586
# Remove the duplicated country code
587-
phone = "+43" + phone[5:]
588-
elif region == "AT" and phone.startswith("4343"):
589-
# Handle case without + prefix
590-
phone = "43" + phone[4:]
587+
phone = phone.replace("4343", "43")
591588

592589
# Sub out anything that matches this regex statement with an empty string to get rid of extensions in generated phone numbers
593590
phone = re.sub(r"\s*(?:x|ext)\s*\d*$", "", phone, flags=re.IGNORECASE)

0 commit comments

Comments
 (0)