Add check for "Account On Hold"

This commit is contained in:
Adam Goldsmith 2018-05-08 20:27:32 -04:00
parent 8dd7904c5f
commit e443380153

View File

@ -87,7 +87,8 @@ def makeMember(member, doorAuth):
"Email": member["Email"],
"Phone": member["Phone"]}
if doorAuth:
if member[doorAuth] == "Y" \
and not member["Account on Hold"] == "Account on Hold":
memberLevel = [v for k, v in memberLevels.items() if member[k] == k]
if len(memberLevel) == 1:
out["Schedule1"] = memberLevel[0]
@ -125,7 +126,7 @@ def makeDoor(doorName, doorIPs, members):
writer = csv.DictWriter(outString, fieldnames)
writer.writeheader()
for member in members:
member = makeMember(member, member["Access " + doorName + "?"] != "")
member = makeMember(member, "Access " + doorName + "?")
if member is not None:
writer.writerow(member)