Skip to content

Commit

Permalink
cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
sara committed Jul 4, 2018
1 parent 712e632 commit d4c6984
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions garfield/lookup/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,16 @@ def lookup_contact(request):
in our db and return meta data
:param request A query dict from twilio
"""
print(request.GET)
suspect_number = request.GET.get('Body')
if suspect_number[1:].isdigit() is False:
print (suspect_number[1:])
error_message = "Error on input %s \nPhone numbers may only contain +[country code] and numeric characters, please check your syntax\n" % (suspect_number)
raise InputError(suspect_number, error_message)
#init an empty dict for suspect info
suspect_information = {}
try:
contact = Contact.objects.get(phone_number = suspect_number)
# if contact != None:
num_texts = contact.sms_message_count
num_calls = contact.call_count
suspect_contact_count = contact.contact_count
#carrier information
suspect_carrier = contact.carrier
suspect_information['phone_number'] = suspect_number
suspect_information['num_texts'] = num_texts
Expand All @@ -77,7 +72,6 @@ def lookup_contact(request):
Contact.DoesNotExist
return (suspect_information)


class Error(Exception):
pass

Expand Down

0 comments on commit d4c6984

Please sign in to comment.