From 685aaf0bdde5ebeaa59ac39112dd2633cf791666 Mon Sep 17 00:00:00 2001 From: Jaculabilis Date: Sat, 27 Jan 2018 17:48:32 -0600 Subject: [PATCH] Fixed naming error --- validate.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/validate.py b/validate.py index 1f83345..b2741c1 100644 --- a/validate.py +++ b/validate.py @@ -67,22 +67,22 @@ def read_loop(): # Begin the loop while True: # Read in the ID - scanned_id = socket.recv() + code = socket.recv() # Determine ID authorization - authorized = id in access and "authorized" in access[id] and access[id]["authorized"] - user = access[id]["user"] if id in access and "user" in access[id] else "unknown id" + authorized = code in access and "authorized" in access[code] and access[code]["authorized"] + user = access[code]["user"] if code in access and "user" in access[code] else "unknown barcode" # If the user is not authorized, deny access if not authorized: - s = timestamped("Denied {} ({})\n".format(id, user)) + s = timestamped("Denied {} ({})\n".format(code, user)) log_file.write(s) print s, # If the user is authorized, perform the unlock procedure else: - s = timestamped("Validated {} {}\n".format(id, user)) + s = timestamped("Validated {} {}\n".format(code, user)) log_file.write(s) print s, # TODO: Play open tone - if "sound" in access[id]: + if "sound" in access[code]: pass # Run unlock procedure unlock_door(pwm_pin)