diff options
Diffstat (limited to 'testapi/opnfv_testapi/resources')
-rw-r--r-- | testapi/opnfv_testapi/resources/result_handlers.py | 6 |
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 2e15e7a..f9706fc 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 |