class Home(panikweb.views.Home):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
- context['emissions'] = Emission.objects.filter(archived=False).order_by('title')
+ context['emissions'] = list(Emission.objects.filter(archived=False).order_by('title'))
+ # force detour-vers-le-futur to go first
+ detour = [x for x in context['emissions'] if x.slug == 'detour-vers-le-futur']
+ context['emissions'] = detour + [x for x in context['emissions'] if x.slug != 'detour-vers-le-futur']
context['newsitems'] = NewsItem.objects.exclude(date__gt=datetime.date.today()
).exclude(expiration_date__lt=datetime.date.today()).order_by('-date')[:3]
context['extra_pages'] = Page.objects.filter(exclude_from_navigation=False)
if emission.archived:
current_year = emission.creation_timestamp.replace(month=5, day=1)
else:
- current_year = datetime.datetime.now().replace(month=5, day=1).replace(year=2019)
+ current_year = datetime.datetime.now().replace(month=5, day=1).replace(year=2021)
episodes_queryset = Episode.objects.select_related()
if episode_ids is not None: