Skip to content

Commit

Permalink
feat: this changes the current phone number regex to allow the plus s…
Browse files Browse the repository at this point in the history
…ymbol in the first character
  • Loading branch information
andrey-canon committed Jul 12, 2024
1 parent 893c70b commit 69228b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/user_api/accounts/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class PhoneNumberSerializer(serializers.BaseSerializer): # lint-amnesty, pylint

def to_internal_value(self, data):
"""Remove all non numeric characters in phone number"""
return re.sub("[^0-9]", "", data) or None
return re.sub(r'(?!^)\+|[^0-9+]', "", data) or None


class LanguageProficiencySerializer(serializers.ModelSerializer):
Expand Down

0 comments on commit 69228b5

Please sign in to comment.