Commit 3726d31b authored by Hiro's avatar Hiro 🏄
Browse files

Add updates for db connections

parent a63fd0f0
......@@ -45,7 +45,7 @@ class SQLite3(object):
"""
Perform a new request to the database
"""
query = "INSERT INTO requests VALUES(?, ?, ?, ?, ?, ?)"
query = "INSERT INTO requests VALUES(?, ?, ?, ?, ?, ?, ?)"
return self.dbpool.runQuery(
query, (id, command, platform, language, service, date, status)
......@@ -96,11 +96,11 @@ class SQLite3(object):
query, (now_str,platform, command, service, now_str)
).addCallback(self.query_callback).addErrback(self.query_errback)
def get_links(self, platform, status):
def get_links(self, platform, language, status):
"""
Get links from the database per platform
"""
query = "SELECT * FROM links WHERE platform=? AND status=?"
query = "SELECT * FROM links WHERE platform=? AND language=? AND status=?"
return self.dbpool.runQuery(
query, (platform, status)
query, (platform, language, status)
).addCallback(self.query_callback).addErrback(self.query_errback)
......@@ -27,7 +27,7 @@ class EmailServiceTests(unittest.TestCase):
def test_language_email_parser(self):
ep = conftests.EmailParser(self.settings, "gettor@torproject.org")
request = ep.parse("From: \"silvia [hiro]\" <hiro@torproject.org>\n Subject: osx en\r\n Reply-To: hiro@torproject.org \nTo: gettor@torproject.org\n osx English")
request = ep.parse("From: \"silvia [hiro]\" <hiro@torproject.org>\n Subject: \r\n Reply-To: hiro@torproject.org \nTo: gettor@torproject.org\n osx en")
self.assertEqual(request["command"], "links")
self.assertEqual(request["platform"], "osx")
self.assertEqual(request["language"], "en")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment