You're checking the waffle flag on every iteration -- that's probably going to be expensive. Why not do something like this:
```python
if waffle.flag_is_active(request, 'Tab Merge Group'):
    course_tabs = [tab for tab in course.tabs if tab['type'] != "course_info"]
else:
    course_tabs = course.tabs
for tab in course_tabs:
    # ...
```