Open zoeyli-46 opened 2 months ago
Do we have more information about this issue? Anything related to the operator that has this invalid number.
I'm surprised that the backend would accept a longer phone number. Though our PhoneWidget currently accepts longer numbers, both the input as well as the format validation doesn't trigger if you continue to type more numbers after inputting a valid one.
I just noticed that this is about cra_business_number
and not phone_number
😄
I have checked the PROD data and we currently don't have any cra_business_number
longer than 9 digits. We also have a validator on the back and front end to ensure this number is always 9 digits.
We can look into it more if we know more details about this operator, so I think closing this issue is okay.
I suggest keeping this open, though perhaps we can rename it to be more general. I just tried another phone number field and it passes frontend validation with a lengthy number. Though thankfully we have the backend saving us, maybe this isn't high priority but I would like to fix it and maybe hardcode a max length into our PhoneWidget
to ensure consistency.
Business area found that the business number field allows more than 9 digits; they received an entry with an incorrect format for the business number. This should be confirmed if that was a one-off situation, or if the form field validation has a bug.
This fix could possibly take care of #886 if we are changing the validation regex (maybe we can use the one Django uses)
FormBase
should correctly invalidate long numbers. Either we can find a new one or modify the existing one to accept a max number.