doorUpdater: Allow people to have multiple schedules

This commit is contained in:
Adam Goldsmith 2018-06-01 13:59:43 -04:00
parent e9ce04e3cd
commit 3df228afd5

View File

@ -84,13 +84,11 @@ def makeMember(member, doorAuth):
if member[doorAuth] == "Y" \
and not member["Account on Hold"] == "Account on Hold":
memberLevel = [(k, v) for k, v in memberLevels.items() if member[k] == k]
if len(memberLevel) == 1:
out["Custom1"] = memberLevel[0][0].replace("&", "and")
out["Schedule1"] = memberLevel[0][1]
else:
print(member["First Name"], member["Last Name"],
"has no/too many member levels!")
levels = {k: v for k, v in memberLevels.items() if member[k] == k}
out["Custom1"] = "|".join(levels.keys()).replace("&", "and")
for index, schedule in enumerate(levels.values(), 1):
#TODO: error if people have more than 8?
out["Schedule" + str(index)] = schedule
return out