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

Mobile number should only accept Integers! #1

Open
imlegend19 opened this issue Jul 20, 2018 · 0 comments
Open

Mobile number should only accept Integers! #1

imlegend19 opened this issue Jul 20, 2018 · 0 comments

Comments

@imlegend19
Copy link
Member

In models.py,

class Feedback(CreateUpdateModel):
     ...
     mobile = models.CharField(_('Mobile Number'), max_length=15, blank=True)

Since, mobile field is CharField, it also accepts characters which it should not!
To validate, you can employ some combination of formatting and then attempting to contact the number immediately to verify. You should use RegexValidator.

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

No branches or pull requests

1 participant