-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove old phonenumber validation #4254
Draft
rparke
wants to merge
6
commits into
main
Choose a base branch
from
remove-old-phonenumber-validation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rparke
force-pushed
the
remove-old-phonenumber-validation
branch
from
November 8, 2024 15:47
4316277
to
8a40080
Compare
Getting formatted phone numbers or international phone information is a repeated pattern so we have created a few utility functions for them to avoid code reuse
…d utility functions using it
…thods and utility methods using it
rparke
force-pushed
the
remove-old-phonenumber-validation
branch
6 times, most recently
from
November 11, 2024 15:48
8a897aa
to
5cac882
Compare
… validation code the old validation code was less rigorous in checking if numbers were truly valid. This has meant some actually invalid numbers have made their way into our unit tests. These needed fixing in order for the tests to work properly with the new code
…needs changing to the major version of utils with the correct changes in
rparke
force-pushed
the
remove-old-phonenumber-validation
branch
from
November 11, 2024 15:50
5cac882
to
afb99ab
Compare
…ude country code when a flag is passed In certain situations we don't want to the numbers country code to be pre-pended to the formatted number. A good example is when we are wanting to query the db with the LIKE or ILIKE operators. Formatting with the country code can produce unexpected formatting when searching on a number fragment, so searching is easier if this is just removed.
rparke
force-pushed
the
remove-old-phonenumber-validation
branch
from
November 11, 2024 15:58
afb99ab
to
b667a44
Compare
CrystalPea
reviewed
Nov 13, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, will approve when utils commit hash is subbed for a version number.
except InvalidPhoneError as error: | ||
raise ValidationError(f"Invalid phone number: {error.get_legacy_v2_api_error_message()}") from error | ||
|
||
@post_load | ||
def format_phone_number(self, item, **kwargs): | ||
item["to"] = validate_and_format_phone_number(item["to"], international=True) | ||
item["to"] = parse_and_format_phone_number(item["to"], international=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this new function doesn't have international flag, right?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.