I'd do this as 
```
if filter_type:
    ...
    return ...

```