From 8013a64f8c7c993b29a620c8ccd8f970ad90e8eb Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 1 May 2012 19:57:30 +0000 Subject: [PATCH] minor refactoring --- plugins/generic/enumeration.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index e9bfe07cd..ccddb3823 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -1608,8 +1608,9 @@ class Enumeration: else: query = rootQuery.inband.query % (colString, conf.db, tbl) elif Backend.getIdentifiedDbms() in (DBMS.MYSQL, DBMS.PGSQL): - _ = sorted(sorted(colList, key=len), lambda x, y: -1 if x and "id" in x.lower() else 1 if y and "id" in y.lower() else 0) - query = rootQuery.inband.query % (colString, conf.db, tbl, _[0]) + _ = lambda x: x and "id" in x.lower() + orderby = sorted(sorted(colList, key=len), lambda x, y: -1 if _(x) and not _(y) else 1 if not _(x) and _(y) else 0)[0] + query = rootQuery.inband.query % (colString, conf.db, tbl, orderby) else: query = rootQuery.inband.query % (colString, conf.db, tbl)