1.1 --- a/imiptools/stores/database/common.py Fri Apr 22 00:06:49 2016 +0200
1.2 +++ b/imiptools/stores/database/common.py Fri Apr 22 00:09:07 2016 +0200
1.3 @@ -474,7 +474,7 @@
1.4 values = [user]
1.5
1.6 query, values = self.get_query(
1.7 - "select distinct other from freebusy_others :condition",
1.8 + "select distinct other from freebusy_other :condition",
1.9 columns, values)
1.10
1.11 self.cursor.execute(query, values)
1.12 @@ -614,7 +614,7 @@
1.13 columns, values)
1.14
1.15 self.cursor.execute(query, values)
1.16 - return self.cursor.fetchall()
1.17 + return [r[0] for r in self.cursor.fetchall()]
1.18
1.19 def get_counter(self, user, other, uid, recurrenceid=None):
1.20
1.21 @@ -814,7 +814,10 @@
1.22
1.23 "Return a list of quotas."
1.24
1.25 - query = "select distinct journal_quota from quota_freebusy"
1.26 + query = "select distinct quota from (" \
1.27 + "select quota from quota_freebusy " \
1.28 + "union all select quota from quota_limits" \
1.29 + ") as quotas"
1.30 self.cursor.execute(query)
1.31 return [r[0] for r in self.cursor.fetchall()]
1.32
1.33 @@ -829,7 +832,7 @@
1.34 "select distinct user_group from quota_freebusy :condition",
1.35 columns, values)
1.36
1.37 - self.cursor.execute(query)
1.38 + self.cursor.execute(query, values)
1.39 return [r[0] for r in self.cursor.fetchall()]
1.40
1.41 # Groups of users sharing quotas.
1.42 @@ -942,7 +945,7 @@
1.43 "select distinct store_user from user_freebusy :condition",
1.44 columns, values)
1.45
1.46 - self.cursor.execute(query)
1.47 + self.cursor.execute(query, values)
1.48 return [r[0] for r in self.cursor.fetchall()]
1.49
1.50 def get_freebusy(self, quota, user, mutable=False):