forked from CMS/memberPlumbing
doorUpdater: Add "Staffed Hours Only" limited operations role
Also fix new name for old "access permitted during limited operations" role, which now allows for access during limited operations using the member's normal access hours
This commit is contained in:
parent
50952bdb46
commit
2eacb46353
@ -74,7 +74,13 @@ class MembershipworksMember(Member):
|
|||||||
|
|
||||||
self.onHold = data["Account on Hold"] != ""
|
self.onHold = data["Account on Hold"] != ""
|
||||||
self.limitedOperations = (
|
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
|
self.formerMember = formerMember
|
||||||
|
|
||||||
@ -98,16 +104,16 @@ class MembershipworksMember(Member):
|
|||||||
def to_DoorMember(self, door):
|
def to_DoorMember(self, door):
|
||||||
doorLevels = [k for k, v in self.extraLevels.items() if door.name in v]
|
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 = []
|
schedules = []
|
||||||
else:
|
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
|
schedules = self.schedules + doorLevels
|
||||||
|
|
||||||
|
# members should get only the staffed hours schedule
|
||||||
|
if self.staffedLimitedOperations:
|
||||||
|
schedules += ["Staffed Hours"]
|
||||||
|
|
||||||
dm = DoorMember(
|
dm = DoorMember(
|
||||||
door,
|
door,
|
||||||
forename=self.forename,
|
forename=self.forename,
|
||||||
@ -336,7 +342,7 @@ def main():
|
|||||||
config = Config()
|
config = Config()
|
||||||
membershipworks = config.membershipworks
|
membershipworks = config.membershipworks
|
||||||
membershipworks_attributes = (
|
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(
|
memberData = membershipworks.get_members(
|
||||||
|
Loading…
Reference in New Issue
Block a user