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