From 5eedb02cc423252197f9ae9a257d32d69d7d48e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chaocao=E2=80=9D?= <“haocao@iflytek.com”> Date: Tue, 9 Oct 2018 09:51:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E5=A4=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/www/teleport/webroot/app/model/account.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/www/teleport/webroot/app/model/account.py b/server/www/teleport/webroot/app/model/account.py index 9a4cc0b..3cb22b5 100644 --- a/server/www/teleport/webroot/app/model/account.py +++ b/server/www/teleport/webroot/app/model/account.py @@ -221,6 +221,8 @@ def get_accounts(sql_filter, sql_order, sql_limit, sql_restrict, sql_exclude): for _acc in s.recorder: if _acc.host_id not in host_ids: host_ids.append(_acc.host_id) + if len(host_ids) == 0: + return TPE_OK, 0, 1, None s_host = SQL(db) s_host.select_from('host', ['id', 'name', 'ip', 'router_ip', 'router_port', 'state'], alt_name='h') str_host_ids = ','.join([str(i) for i in host_ids])