diff options
author | cpettet <rush@wikimedia.org> | 2014-11-19 22:34:40 -0600 |
---|---|---|
committer | cpettet <rush@wikimedia.org> | 2014-11-19 22:35:15 -0600 |
commit | e80e40957279634a8bfa0c859ffaac1f606ef532 (patch) | |
tree | 7da172c799baed77f18de754c7e40e98317a27fa | |
parent | 3e84e3075dcca0228f9c9f7ea48abf1447a7ea03 (diff) |
read phid of mailing list correctly
-rw-r--r-- | nano | 0 | ||||
-rwxr-xr-x | wmfphablib/phabdb.py | 9 |
2 files changed, 3 insertions, 6 deletions
diff --git a/wmfphablib/phabdb.py b/wmfphablib/phabdb.py index af16a87..d4ddf2d 100755 --- a/wmfphablib/phabdb.py +++ b/wmfphablib/phabdb.py @@ -692,8 +692,6 @@ def set_task_id(id, phid): p = phdb(db='phabricator_maniphest', user=phuser_user, passwd=phuser_passwd) - - print "UPDATE maniphest_task set id=%s where phid=%s" % (id, phid) p.sql_x("UPDATE maniphest_task set id=%s where phid=%s", (id, phid)) p.close() @@ -904,14 +902,13 @@ def mailinglist_phid(list_email): :param list_emai: email str """ p = phdb(db="phabricator_metamta") - phid = p.sql_x("SELECT * \ + _ = p.sql_x("SELECT * \ FROM metamta_mailinglist \ WHERE email = %s", (list_email)) - if phid: - phid = phid[1] p.close() - return phid + if _ is not None and len(_[0]) > 0: + return _[0][1] def archive_project(project): """set a project as archived""" |