diff options
Diffstat (limited to 'scripts/listcontexts.py')
-rw-r--r-- | scripts/listcontexts.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/listcontexts.py b/scripts/listcontexts.py index 01c2403..4aae8bc 100644 --- a/scripts/listcontexts.py +++ b/scripts/listcontexts.py @@ -12,7 +12,8 @@ class ListContexts: def rankingsExist(self, contextId): rankings = execQuery( - "SELECT id FROM ranking WHERE context2Id = %d LIMIT 1;" % contextId) + "SELECT id FROM ranking WHERE context2Id = %s LIMIT 1", + (contextId,)) return len(rankings) > 0 @@ -23,8 +24,9 @@ class ListContexts: "SELECT id, hostId, platformId, branchId, sha1Id," " EXTRACT(EPOCH FROM timestamp)::INT" " FROM context" - " ORDER BY hostId, platformId, branchId, timestamp DESC;") \ - + [(-1, -1, -1, -1, -1, -1)] # Sentinel value + " ORDER BY hostId, platformId," + " branchId, timestamp DESC;", ()) \ + + [(-1, -1, -1, -1, -1, -1)] # Sentinel value self.contexts = [] |