diff --git a/memberPlumbing/doorUpdater.py b/memberPlumbing/doorUpdater.py index 87113f3..d21d417 100755 --- a/memberPlumbing/doorUpdater.py +++ b/memberPlumbing/doorUpdater.py @@ -74,7 +74,13 @@ class MembershipworksMember(Member): self.onHold = data["Account on Hold"] != "" self.limitedOperations = ( - data["Access Permitted During Limited Operations"] == "Y" + data[ + "Access Permitted Using Membership Level Schedule During COVID-19 Limited Operations" + ] + == "Y" + ) + self.staffedLimitedOperations = ( + data["Access Permitted During COVID-19 Staffed Period Only"] == "Y" ) self.formerMember = formerMember @@ -98,15 +104,15 @@ class MembershipworksMember(Member): def to_DoorMember(self, door): doorLevels = [k for k, v in self.extraLevels.items() if door.name in v] - if ( - door.name not in self.doorAccess - or self.onHold - or self.formerMember - or not self.limitedOperations - ): - schedules = [] - else: - schedules = self.schedules + doorLevels + schedules = [] + if door.name in self.doorAccess and not self.onHold and not self.formerMember: + # members should get their normal schedules + if self.limitedOperations: + schedules = self.schedules + doorLevels + + # members should get only the staffed hours schedule + if self.staffedLimitedOperations: + schedules += ["Staffed Hours"] dm = DoorMember( door, @@ -336,7 +342,7 @@ def main(): config = Config() membershipworks = config.membershipworks membershipworks_attributes = ( - "_id,nam,phn,eml,lvl,lbl,xws,xms,xsc,xas,xfd,xac,xcf,xeh,xse,xlo" + "_id,nam,phn,eml,lvl,lbl,xws,xms,xsc,xas,xfd,xac,xcf,xeh,xse,xlo,xxc" ) memberData = membershipworks.get_members(