# HG changeset patch # User Paul Boddie # Date 1461276547 -7200 # Node ID e690f82677364f4799fa8da9208543f1bb8ca5ff # Parent 732f324ba395d5f8dafc922b3565c024de956e8e Made the get_quotas method look in the quota_freebusy and quota_limits tables. Fixed the result type of get_counters. Fixed query execution where values were missing. diff -r 732f324ba395 -r e690f8267736 imiptools/stores/database/common.py --- a/imiptools/stores/database/common.py Fri Apr 22 00:06:49 2016 +0200 +++ b/imiptools/stores/database/common.py Fri Apr 22 00:09:07 2016 +0200 @@ -474,7 +474,7 @@ values = [user] query, values = self.get_query( - "select distinct other from freebusy_others :condition", + "select distinct other from freebusy_other :condition", columns, values) self.cursor.execute(query, values) @@ -614,7 +614,7 @@ columns, values) self.cursor.execute(query, values) - return self.cursor.fetchall() + return [r[0] for r in self.cursor.fetchall()] def get_counter(self, user, other, uid, recurrenceid=None): @@ -814,7 +814,10 @@ "Return a list of quotas." - query = "select distinct journal_quota from quota_freebusy" + query = "select distinct quota from (" \ + "select quota from quota_freebusy " \ + "union all select quota from quota_limits" \ + ") as quotas" self.cursor.execute(query) return [r[0] for r in self.cursor.fetchall()] @@ -829,7 +832,7 @@ "select distinct user_group from quota_freebusy :condition", columns, values) - self.cursor.execute(query) + self.cursor.execute(query, values) return [r[0] for r in self.cursor.fetchall()] # Groups of users sharing quotas. @@ -942,7 +945,7 @@ "select distinct store_user from user_freebusy :condition", columns, values) - self.cursor.execute(query) + self.cursor.execute(query, values) return [r[0] for r in self.cursor.fetchall()] def get_freebusy(self, quota, user, mutable=False):