pytition / Pytition

Django app for self-hosted privacy-friendly online petitions
https://pytition.org
BSD 3-Clause "New" or "Revised" License
99 stars 28 forks source link

Add phone number validation to sign form #255

Closed requiem958 closed 2 years ago

requiem958 commented 3 years ago

Is your feature request related to a problem? Please describe. I see that there is a detection of whether an email is correct but not on the phone number. Adding this detection would be coherent if phone number stays mandatory.

Describe the solution you'd like Same interface as validation of e-mail, but for phone numbers.

Additional context After crawling the web, it seems difficult to just verify all phone numbers for all country, so it must maybe be precised that only some format will be accepted.

Some regex i found ^(?:(?:\+|00)33[\s.-]{0,3}(?:\(0\)[\s.-]{0,3})?|0)[1-9](?:(?:[\s.-]?\d{2}){4}|\d{2}(?:[\s.-]?\d{3}){2})$ But only for french phone numbers, source