Fix datetime compare error
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
2c63dcf25c
commit
e8ad176824
@ -217,7 +217,7 @@ def view_doorboy_admin():
|
|||||||
|
|
||||||
orphaned_keyfobs = user_keyfobs.pop(None)
|
orphaned_keyfobs = user_keyfobs.pop(None)
|
||||||
no_keyfobs = [u for u in users if not user_keyfobs.get(u.username)]
|
no_keyfobs = [u for u in users if not user_keyfobs.get(u.username)]
|
||||||
last_seen = {key : max(card.get("last_seen") for card in value) for key, value in user_keyfobs.items()}
|
last_seen = {key : max(card.get("last_seen", datetime.min) 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", "")))
|
||||||
no_keyfobs = sorted(no_keyfobs, key = lambda u : u.display_name or u.username)
|
no_keyfobs = sorted(no_keyfobs, key = lambda u : u.display_name or u.username)
|
||||||
|
Loading…
Reference in New Issue
Block a user