Skip to content
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

HER-26-Improve-Phone-Number-Validation-for-Orders #28

Merged
merged 5 commits into from
Dec 20, 2024

Conversation

bbcc33
Copy link
Collaborator

@bbcc33 bbcc33 commented Dec 16, 2024

HER-26 Improve Phone Number Validation for Orders

Issue

As a user, I would like the Kit Request (Order) form to be more accepting of my phone number.
HER-27

Changes

1 - Changed the validation for a phone number to ensure 10 digits are entered
2 - Changed the validation for a school year to accept YYYY, YYYY-YY, or YYYY-YY format
3 - Added def normalize_phone_number to do a before_validation check that the phone number field is not blank, removes any characters that are not 0-9, and removes any leading 1

Review Checklist

  • I have documented my code with code comments.

Copy link
Collaborator

@trca831 trca831 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

@mhope21 mhope21 left a comment

Choose a reason for hiding this comment

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

Everything looks good, just remove commented out code and make the tests match your validations so that they pass.

@bbcc33
Copy link
Collaborator Author

bbcc33 commented Dec 17, 2024

normalize_phone_number was previously deleting any kind of 1 that began on a phone number, therefore truncating it, which was failing the tests. It now deletes any non numerical characters and checks that the phone number is 10 digits long, if not it deletes the 1 that usually people add for international calling from the US, therefore making it 10 digits long

@bbcc33 bbcc33 requested a review from mhope21 December 18, 2024 01:28
@mhope21
Copy link
Collaborator

mhope21 commented Dec 19, 2024

Sorry, I didn't realize I was holding you up. Don't forget to update branch.

@bbcc33 bbcc33 requested a review from dsinn as a code owner December 20, 2024 01:28
@bbcc33 bbcc33 merged commit 93a4723 into main Dec 20, 2024
3 checks passed
@bbcc33 bbcc33 deleted the HER-26-Improve-Phone-Number-Validation-for-Orders branch December 20, 2024 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants