forked from CMS/memberPlumbing
doorUpdater: Allow people to have multiple schedules
This commit is contained in:
parent
e9ce04e3cd
commit
3df228afd5
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user