you could just 
```
if params['_return_query'][0].value[0]:
    return ...
```