summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/resources/result_handlers.py
diff options
context:
space:
mode:
Diffstat (limited to 'testapi/opnfv_testapi/resources/result_handlers.py')
-rw-r--r--testapi/opnfv_testapi/resources/result_handlers.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/testapi/opnfv_testapi/resources/result_handlers.py b/testapi/opnfv_testapi/resources/result_handlers.py
index 1773216..57ad27e 100644
--- a/testapi/opnfv_testapi/resources/result_handlers.py
+++ b/testapi/opnfv_testapi/resources/result_handlers.py
@@ -60,6 +60,12 @@ class GenericResultHandler(handlers.GenericApiHandler):
query[k] = v
if date_range:
query['start_date'] = date_range
+
+ # if $lt is not provided,
+ # empty/None/null/'' start_date will also be returned
+ if 'start_date' in query and '$lt' not in query['start_date']:
+ query['start_date'].update({'$lt': str(datetime.now())})
+
return query