aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcpettet <rush@wikimedia.org>2014-11-19 22:34:40 -0600
committercpettet <rush@wikimedia.org>2014-11-19 22:35:15 -0600
commite80e40957279634a8bfa0c859ffaac1f606ef532 (patch)
tree7da172c799baed77f18de754c7e40e98317a27fa
parent3e84e3075dcca0228f9c9f7ea48abf1447a7ea03 (diff)
read phid of mailing list correctly
-rw-r--r--nano0
-rwxr-xr-xwmfphablib/phabdb.py9
2 files changed, 3 insertions, 6 deletions
diff --git a/nano b/nano
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/nano
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"""