Fix no keyfobs panel
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful
This commit is contained in:
parent
fe301f9c9a
commit
d3809d568c
@ -248,9 +248,7 @@ def view_doorboy_admin():
|
|||||||
|
|
||||||
orphaned_keyfobs = user_keyfobs.pop(None)
|
orphaned_keyfobs = user_keyfobs.pop(None)
|
||||||
no_keyfobs = [u for u in g.users if not user_keyfobs.get(u.username)]
|
no_keyfobs = [u for u in g.users if not user_keyfobs.get(u.username)]
|
||||||
for u in no_keyfobs:
|
no_keyfobs = list(filter(lambda u : u.user_type == "person", no_keyfobs))
|
||||||
if u.user_type != "person":
|
|
||||||
del no_keyfobs[u.username]
|
|
||||||
last_seen = {key : max(datetime_handle(card.get("last_seen")) for card in value) for key, value in user_keyfobs.items()}
|
last_seen = {key : max(datetime_handle(card.get("last_seen")) for card in value) for key, value in user_keyfobs.items()}
|
||||||
|
|
||||||
orphaned_keyfobs = sorted(orphaned_keyfobs, key = lambda o : (not bool(o.get("comment")), o.get("comment", "")))
|
orphaned_keyfobs = sorted(orphaned_keyfobs, key = lambda o : (not bool(o.get("comment")), o.get("comment", "")))
|
||||||
|
Loading…
Reference in New Issue
Block a user