You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the validation of phone number is left to the model fields, but the AbstractShippingAddress model can't really do phone validation alone, the only thing it can do is to use the PHONENUMBER_DEFAULT_REGION settings, which is not enough.
Oscar side, with good old forms, they use a PhoneNumberMixin which does the validation like (simplified):
Maybe UserAddressSerializer could have its own phone number validation, making use of the user provided country to give a proper region to the phonenumber_field library?
The text was updated successfully, but these errors were encountered:
Currently the validation of phone number is left to the model fields, but the
AbstractShippingAddress
model can't really do phone validation alone, the only thing it can do is to use thePHONENUMBER_DEFAULT_REGION
settings, which is not enough.Oscar side, with good old forms, they use a
PhoneNumberMixin
which does the validation like (simplified):Maybe
UserAddressSerializer
could have its own phone number validation, making use of the user provided country to give a proper region to thephonenumber_field
library?The text was updated successfully, but these errors were encountered: