Can this not be 
```
 if params['versions'] and params['report_type'] is not in ('products', 'distinct_install'): 
```