From 71d22278540fb9162af4ee1e7b31e92e52500066 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Tue, 24 Dec 2024 10:36:03 -0500 Subject: [PATCH] doorcontrol: Treat members in "Misc. Access" folder as active for Access --- doorcontrol/tasks/update_unifi_access.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doorcontrol/tasks/update_unifi_access.py b/doorcontrol/tasks/update_unifi_access.py index aecac99..67cf39e 100644 --- a/doorcontrol/tasks/update_unifi_access.py +++ b/doorcontrol/tasks/update_unifi_access.py @@ -149,7 +149,12 @@ def sync_members(access_client: AccessClient): if access_user := access_users_by_employee_number.get(member.uid): expected_user["status"] = ( - UserStatus.ACTIVE if member.is_active else UserStatus.DEACTIVATED + UserStatus.ACTIVE + if ( + member.is_active + or member.flags.filter(name="Misc. Access", type="folder").exists() + ) + else UserStatus.DEACTIVATED ) changes = { k: v for k, v in expected_user.items() if getattr(access_user, k) != v