Commit 2069ccab authored by Giorgos Verigakis's avatar Giorgos Verigakis
Browse files

Immediately convert dates to naive format

Please verify that it fixes #377

Refs: #377
parent 5da8e700
......@@ -45,14 +45,15 @@ def isoparse(s):
since = dateutil.parser.parse(s)
utc_since = since.astimezone(UTC()).replace(tzinfo=None)
except ValueError:
raise BadRequest('Invalid changes-since parameter.')
now =
if since > now:
now =
if utc_since > now:
raise BadRequest('changes-since value set in the future.')
if now - since > timedelta(seconds=settings.POLL_LIMIT):
if now - utc_since > timedelta(seconds=settings.POLL_LIMIT):
raise BadRequest('Too old changes-since value.')
return since
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment