diff --git a/doorUpdater.py b/doorUpdater.py index e508a17..0e8e15a 100755 --- a/doorUpdater.py +++ b/doorUpdater.py @@ -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