Don't show event as current when not accepting projects anymore

This commit is contained in:
Antoine Martin 2022-05-13 10:46:08 +02:00
parent 429903bedf
commit e78b72e587

View file

@ -14,8 +14,8 @@ class IndexView(TemplateView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs) context = super().get_context_data(**kwargs)
today = timezone.now().date() today = timezone.now().date()
context['current_event'] = models.Event.objects.filter(date=today).first() context['current_event'] = models.Event.objects.filter(date=today, accept_projects=True).first()
context['past_events'] = models.Event.objects.exclude(date=today).order_by('-date') context['past_events'] = models.Event.objects.exclude(date=today, accept_projects=True).order_by('-date')
return context return context