def builds(self): from tcms.management.models import TestBuild query = { 'product_id': self.product_id, 'is_active': self.request.GET.get('is_active') } return TestBuild.list(query)
def builds(self): from tcms.management.models import TestBuild try: _is_active = bool( strtobool(self.request.GET.get('is_active', 'False'))) except (ValueError, TypeError): _is_active = False query = {'product_id': self.product_id, 'is_active': _is_active} return TestBuild.list(query)