From: Michael Tremer Date: Tue, 28 Apr 2015 09:01:03 +0000 (+0200) Subject: fireinfo: Let get_profile() return only valid profiles X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=46f3e814b20bd20696dfe9e83e1726aeec170007;p=ipfire.org.git fireinfo: Let get_profile() return only valid profiles --- diff --git a/webapp/backend/fireinfo.py b/webapp/backend/fireinfo.py index b4b74248..3f4be977 100644 --- a/webapp/backend/fireinfo.py +++ b/webapp/backend/fireinfo.py @@ -1496,10 +1496,9 @@ class Fireinfo(Object): res = self.db.get("SELECT * FROM fireinfo_profiles \ WHERE public_id = %s AND \ (CASE WHEN %s IS NULL THEN TRUE ELSE private_id = %s END) AND \ - (CASE WHEN %s IS NULL THEN TRUE ELSE \ - then_or_now(%s) BETWEEN time_created AND time_valid END) \ - ORDER BY time_updated DESC LIMIT 1", public_id, - private_id, private_id, when, when) + then_or_now(%s) BETWEEN time_created AND time_valid \ + ORDER BY time_updated DESC LIMIT 1", + public_id, private_id, private_id, when) if res: return Profile(self.backend, res.id, res)