This line has a little too much logic in it, and it's difficult to understand. Can you split it into multiple lines?
```python
filter_templates = getattr(component_class, 'filter_templates', None)
if not filter_templates or filter_templates(template, course):
    # ...
```