Jun 24 - Implement devices tracker - Fix 500 error

This commit is contained in:
Nguyen Ngo
2026-06-24 18:01:18 -04:00
parent 173b3f5d97
commit 0a9545d415
+2 -2
View File
@@ -25,7 +25,7 @@ def index():
"""Show all registered devices, most-recently-seen first.""" """Show all registered devices, most-recently-seen first."""
devices = ( devices = (
DeviceToken.query DeviceToken.query
.order_by(DeviceToken.last_seen_at.desc().nullslast()) .order_by(DeviceToken.registered_at.desc())
.all() .all()
) )
return render_template('admin/devices.html', devices=devices) return render_template('admin/devices.html', devices=devices)
@@ -96,4 +96,4 @@ def notify_update():
f'Update notice sent to {notified} user(s) on {len(outdated)} outdated device(s).', f'Update notice sent to {notified} user(s) on {len(outdated)} outdated device(s).',
'success' 'success'
) )
return redirect(url_for('devices.index')) return redirect(url_for('devices.index'))