From fcc92864b38055a26727525736ccda12f449bca4 Mon Sep 17 00:00:00 2001 From: lsetiawan Date: Mon, 8 Jan 2018 14:43:33 -0800 Subject: [PATCH] Allow sfid to be None to work with older code --- odm2api/ODM2/services/readService.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/odm2api/ODM2/services/readService.py b/odm2api/ODM2/services/readService.py index 75b8e2f..ec183d1 100644 --- a/odm2api/ODM2/services/readService.py +++ b/odm2api/ODM2/services/readService.py @@ -801,7 +801,8 @@ def getResults(self, ids=None, restype = None, uuids=None, actionid=None, simula warnings.warn('The parameter \'sfid\' is deprecated. ' 'Please use the sfids parameter instead and send in a list.', DeprecationWarning, stacklevel=2) - query = query.join(FeatureActions).filter_by(SamplingFeatureID=kwargs['sfid']) + if kwargs['sfid']: + query = query.join(FeatureActions).filter_by(SamplingFeatureID=kwargs['sfid']) if sfids or sfcodes or sfuuids: sf_list = self.getSamplingFeatures(ids=sfids, codes=sfcodes, uuids=sfuuids) sfids = []