From c59198887cf3c251947505e8f098968279bad325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Fri, 18 Dec 2015 12:49:37 +0000 Subject: [PATCH] api: Fixed API call for querying leases --- certidude/api/lease.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/certidude/api/lease.py b/certidude/api/lease.py index c678fe5..f6f8597 100644 --- a/certidude/api/lease.py +++ b/certidude/api/lease.py @@ -37,19 +37,22 @@ class LeaseResource(object): # BUGBUG SQL_LEASES = """ - SELECT + select acquired, released, address, identities.data as identity - FROM + from addresses - RIGHT JOIN + right join identities - ON + on identities.id = addresses.identity - WHERE + where addresses.released <> 1 + order by + addresses.id + desc """ cnx = config.DATABASE_POOL.get_connection() cursor = cnx.cursor()