Skip to content

feat: modify PhoneNumberSerializer regex to allow plus symbol at the …#35117

Merged
justinhynes merged 4 commits intoopenedx:masterfrom
eduNEXT:and/update_phone_serializer_regex
Jul 17, 2024
Merged

feat: modify PhoneNumberSerializer regex to allow plus symbol at the …#35117
justinhynes merged 4 commits intoopenedx:masterfrom
eduNEXT:and/update_phone_serializer_regex

Conversation

@andrey-canon
Copy link
Copy Markdown
Contributor

Description

This modifies the current serializer regex that removes all characters that are not numbers, to allow the plus symbol at the start, This modification is made based on this comment

Testing instructions

import re

data = "+57+26100*4-8"
re.sub(r'(?!^)\+|[^0-9+]', "", data) # Expected result  "+572610048"

@andrey-canon andrey-canon requested a review from a team as a code owner July 12, 2024 23:57
@openedx-webhooks
Copy link
Copy Markdown

Thanks for the pull request, @andrey-canon! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jul 12, 2024
@deborahgu deborahgu added the needs maintainer attention Issue or PR specifically needs the attention of the maintainer. label Jul 15, 2024
@justinhynes
Copy link
Copy Markdown
Contributor

Hi there! Thanks for your contribution. Is there any chance you could update the unit tests with this change as well?

Specifically, I'm thinking we should update the test_phone_number_can_only_contain_digits unittest. We should probably update the name (since a non-numerical digit will now be accepted).

Copy link
Copy Markdown
Contributor

@justinhynes justinhynes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my comment -- I'm requesting a tiny update to existing unit tests before accepting this change! :)

@justinhynes justinhynes added needs maintainer attention Issue or PR specifically needs the attention of the maintainer. and removed needs maintainer attention Issue or PR specifically needs the attention of the maintainer. labels Jul 16, 2024
@andrey-canon andrey-canon force-pushed the and/update_phone_serializer_regex branch from d439d77 to d8e4d5e Compare July 16, 2024 22:25
@andrey-canon andrey-canon requested a review from justinhynes July 16, 2024 22:25
Copy link
Copy Markdown
Contributor

@justinhynes justinhynes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, and thanks for reworking the old unit tests. These are much cleaner and easier to read.

I'll go ahead and merge this too.

@justinhynes justinhynes merged commit c370028 into openedx:master Jul 17, 2024
@openedx-webhooks
Copy link
Copy Markdown

@andrey-canon 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@edx-pipeline-bot
Copy link
Copy Markdown
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Copy Markdown
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Copy Markdown
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

mudassir-hafeez pushed a commit to mudassir-hafeez/edx-platform that referenced this pull request Jul 24, 2024
openedx#35117)

* feat: modify PhoneNumberSerializer regex to allow plus symbol at the beginning
* chore: update PhonenumberSerializer docstring
mudassir-hafeez pushed a commit to mudassir-hafeez/edx-platform that referenced this pull request Jul 24, 2024
openedx#35117)

* feat: modify PhoneNumberSerializer regex to allow plus symbol at the beginning
* chore: update PhonenumberSerializer docstring
@itsjeyd itsjeyd removed changes requested needs maintainer attention Issue or PR specifically needs the attention of the maintainer. labels Sep 7, 2024
andrey-canon added a commit to nelc/edx-platform that referenced this pull request Feb 21, 2025
openedx#35117)

* feat: modify PhoneNumberSerializer regex to allow plus symbol at the beginning
* chore: update PhonenumberSerializer docstring
andrey-canon added a commit to nelc/edx-platform that referenced this pull request Feb 21, 2025
openedx#35117)

* feat: modify PhoneNumberSerializer regex to allow plus symbol at the beginning
* chore: update PhonenumberSerializer docstring
andrey-canon added a commit to nelc/edx-platform that referenced this pull request Feb 21, 2025
openedx#35117) (#54)

* feat: modify PhoneNumberSerializer regex to allow plus symbol at the beginning
* chore: update PhonenumberSerializer docstring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done
Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants