doorcontrol: Add some more debug logging in update_doors task
This commit is contained in:
parent
ee48d286c2
commit
b056eb04ed
@ -208,11 +208,14 @@ class DoorMember:
|
||||
|
||||
|
||||
def update_door(door: Door, dry_run: bool = False):
|
||||
logger.info(f"Updating {door}")
|
||||
logger.debug(f"Fetching members from database for {door}")
|
||||
members = [
|
||||
DoorMember.from_membershipworks_member(membershipworks_member, door)
|
||||
for membershipworks_member in (Member.objects.with_is_active()).all()
|
||||
]
|
||||
|
||||
logger.debug(f"Fetching cardholders from {door}")
|
||||
cardholders = {
|
||||
member.membershipworks_id: member
|
||||
for member in [
|
||||
@ -221,11 +224,13 @@ def update_door(door: Door, dry_run: bool = False):
|
||||
]
|
||||
}
|
||||
|
||||
logger.debug(f"Fetching credentials from {door}")
|
||||
existing_door_credentials = {
|
||||
Credential.from_hex(c.attrib["rawCardNumber"])
|
||||
for c in door.controller.get_credentials()
|
||||
}
|
||||
|
||||
logger.debug(f"Syncing members with {door}")
|
||||
# TODO: can I combine requests?
|
||||
for member in members:
|
||||
# cardholder did not exist, so add them
|
||||
|
Loading…
Reference in New Issue
Block a user