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

Validation Layer #13

Closed
Clivern opened this issue Jan 6, 2019 · 2 comments · Fixed by #166
Closed

Validation Layer #13

Clivern opened this issue Jan 6, 2019 · 2 comments · Fixed by #166

Comments

@Clivern
Copy link
Member

Clivern commented Jan 6, 2019

  • Optional Fields.
  • Description Fields.
  • Title / Name / Subject Fields.
  • Markdown Fields.
This was referenced Jan 6, 2019
@Clivern Clivern added this to the Kick off milestone Jan 12, 2019
@Clivern Clivern self-assigned this Jan 21, 2019
@Clivern Clivern removed this from the Kick off milestone Apr 14, 2019
@Clivern Clivern removed their assignment Sep 13, 2019
@Clivern Clivern pinned this issue Sep 15, 2019
@Clivern Clivern unpinned this issue Sep 15, 2019
@Clivern Clivern added this to the Version 1.0.0-beta milestone Sep 15, 2019
@Clivern
Copy link
Member Author

Clivern commented Sep 17, 2019

Phone Twilio Validation

from twilio.rest import Client
from twilio.base.exceptions import TwilioRestException

# Your Account Sid and Auth Token from twilio.com/user/account
# Store them in the environment variables:
# "TWILIO_ACCOUNT_SID" and "TWILIO_AUTH_TOKEN"
client = Client()

def is_valid_number(number):
    try:
        response = client.lookups.phone_numbers(number).fetch(type="carrier")
        return True
    except TwilioRestException as e:
        if e.code == 20404:
            return False
        else:
            raise e

print(is_valid_number('19999999999')) # False
print(is_valid_number('15108675309')) # True

@Clivern
Copy link
Member Author

Clivern commented Sep 27, 2019

Taken care of

@Clivern Clivern self-assigned this Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment