Fix error when using _daysago in search queries. Fixes #1185398 (_daysago search)

This commit is contained in:
Kovid Goyal 2013-05-29 18:15:51 +05:30
parent d836bfff3c
commit d0b8e4248f

View File

@ -367,7 +367,7 @@ class ResultCache(SearchQueryParser): # {{{
qd = now()
field_count = 2
elif query.endswith(self.local_daysago) or query.endswith(self.untrans_daysago):
num = query[0:-self.local_daysago_len]
num = query[0:-(self.local_daysago_len if query.endswith(self.local_daysago) else self.untrans_daysago_len)]
try:
qd = now() - timedelta(int(num))
except: