Example #1
0
def _number_must_not_exist(number):
	''' ensures name doesn't already exist in db '''

	# add +1 at beginning number
	number = "+1" + number

	if number_exists(number):
		raise ValidationError('This phone number has already been taken.')
Example #2
0
def receive_text(): 
    ''' method to recieve texts, parse them, and store in mongo'''

    # store the text body and phone number
    body = request.values.get('Body')
    number = request.values.get('From')
    
    if number_exists(number):
        process.process_existing(body, number)
    else:
        process.process_new(body, number)
Example #3
0
def _process_valid_signup(body, number):    
    if number_exists(number):
        send_already_signed_up(tnumber)
    else:
        send_signup_request(number)