From d04154aa7e6de5411d6e8fc5f92b017c5f71c879 Mon Sep 17 00:00:00 2001 From: kingmo888 <17401091+kingmo888@users.noreply.github.com> Date: Tue, 10 Sep 2024 00:07:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E5=AE=A2=E6=88=B7=E7=AB=AF=E6=9C=AA?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=97=B6=EF=BC=8C=E5=89=8D=E7=AB=AF=E6=89=80?= =?UTF-8?q?=E5=B1=9E=E7=94=A8=E6=88=B7=E6=98=BE=E7=A4=BA[=E6=9C=AA?= =?UTF-8?q?=E7=99=BB=E5=BD=95]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/views_front.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/views_front.py b/api/views_front.py index 1a0b712..0ea320e 100644 --- a/api/views_front.py +++ b/api/views_front.py @@ -229,6 +229,9 @@ def get_all_info(): if device: devices[peer.rid]['rust_user'] = user.username + for rid in devices.keys(): + if not devices[rid].get('rust_user', ''): + devices[rid]['rust_user'] = _('未登录') for k, v in devices.items(): devices[k]['status'] = _('在线') if (now - datetime.datetime.strptime(v['update_time'], '%Y-%m-%d %H:%M')).seconds <= 120 else _('离线') return [v for k, v in devices.items()]