From 2cf749fd6f80381e9d823cd04e6e09afa31dae25 Mon Sep 17 00:00:00 2001 From: crudo Date: Fri, 24 Mar 2017 23:03:13 +0100 Subject: [PATCH] Fix query bug that prevented events with undefined end date being used. --- web.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web.py b/web.py index 96b0878..b9c1584 100644 --- a/web.py +++ b/web.py @@ -94,8 +94,8 @@ def get_products(session): def get_event(session): return session.query(Event)\ .filter(Event.starts_at < datetime.now())\ - .filter((Event.ends_at > datetime.now()) | - (Event.ends_at is None))\ + .filter((Event.ends_at.is_(None)) + | (Event.ends_at > datetime.now()))\ .one_or_none()