add a filter
[wolnelektury.git] / src / experiments / views.py
1 from django.views.generic import TemplateView
2
3
4 class MainSwitchView(TemplateView):
5     template_name = 'experiments/main_switch.html'
6
7     def get_context_data(self):
8         return {
9             'experiments': [
10                 e for e in self.request.EXPERIMENTS.values()
11                 if e.switchable or self.request.user.is_staff
12             ]
13         }