certat / do-portal

This project is in maintenance mode and will only receive bug fixes, but no new features. A new version of this software is being developed.
5 stars 5 forks source link

Input validation (phone and mobile numbers) #60

Closed certrik closed 5 years ago

certrik commented 5 years ago

Please implement as HOTFIX: In the phone and mobile fields of the "Membership Details" area it should only be possible to put in numerical characters (also no spaces) except the plus sign "+" at the beginning of the number. If the input is wrong it should clearly state the problem (with description "Attribute error. Invalid phone or mobile. The number must start with '+' and only comprise numerical characters." ). The warning should be separated from the warning of a wrong email adress.

MarkHofstetter commented 5 years ago

phone numbers are checked with https://github.com/daviddrysdale/python-phonenumbers

which - interestingly - allows letters

x = phonenumbers.parse('+431231231a123', None) print(x) Country Code: 43 National Number: 1231231123

MarkHofstetter commented 5 years ago

fixed in e8df1fd613f1e830a4a7d006ebe12156f22169d4

a better way for error messages has to be found

MarkHofstetter commented 5 years ago

@wagner-certat please merge into release after testing and close issue

certrik commented 5 years ago

related to https://github.com/certat/do-portal/issues/25

ghost commented 5 years ago

@wagner-certat please merge into release after testing and close issue

cherry-picked to release (there's no extra branch for the fix)

Keep in mind that this invalidates existing data. I.e. formerly valid data (e.g. +43 1 95) will be rejected now as invalid.

certrik commented 5 years ago

The issues with the error messages is still present.

MarkHofstetter commented 5 years ago

fixed in f481395e51125d34b495cd1f9122bc5e039df607