It would probably be clearer to not use ternary operators here:
```python
if course and course.tabs:
    discussion_tab = course.tabs.get_discussion()
    discussion_link = discussion_tab.link_func(course)
else:
    discussion_tab = None
    discussion_link = None
```