Fix query bug that prevented events with undefined end date being used.

This commit is contained in:
crudo 2017-03-24 23:03:13 +01:00
parent a6e878c6fd
commit 2cf749fd6f

4
web.py
View File

@ -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()