From dad00883ceab957dcc8343642c3f89eaa9fe28bd Mon Sep 17 00:00:00 2001 From: pyro2927 Date: Thu, 22 Dec 2016 14:52:28 -0700 Subject: [PATCH] Fixing bug in checkin, adding status print --- checkin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/checkin.py b/checkin.py index 44a577c..b246ca4 100755 --- a/checkin.py +++ b/checkin.py @@ -31,6 +31,8 @@ if date > tomorrow: print "Too early to check in, waiting {} seconds".format(delta) time.sleep(delta) +print "Attempting check-in..." + # Get our passengers to get boarding passes for passengers = [] for passenger in body['passengers']: @@ -43,7 +45,7 @@ r = requests.post(url, headers=headers, json={'names': passengers}) body = r.json() -if body['httpStatusCode'] == 'FORBIDDEN': +if 'httpStatusCode' in body and body['httpStatusCode'] == 'FORBIDDEN': print body['message'] else: # Spit out info about boarding number