Skip to content

Commit

Permalink
Don't throw ValueErrors when relative date field is empty (assume 0).
Browse files Browse the repository at this point in the history
  • Loading branch information
esteele committed Mar 25, 2012
1 parent 861fafa commit 8d86eb4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plone/app/querystring/queryparser.py
Expand Up @@ -118,7 +118,10 @@ def _currentUser(context, row):

def _lessThanRelativeDate(context, row):
# INFO: Values is the number of days
values = int(row.values)
try:
values = int(row.values)
except ValueError:
values = 0
now = DateTime()
my_date = now + values
my_date = my_date.earliestTime()
Expand All @@ -130,7 +133,10 @@ def _lessThanRelativeDate(context, row):

def _moreThanRelativeDate(context, row):
# INFO: Values is the number of days
values = int(row.values)
try:
values = int(row.values)
except ValueError:
values = 0
now = DateTime()
my_date = now + values
my_date = my_date.latestTime()
Expand Down

0 comments on commit 8d86eb4

Please sign in to comment.