com: fix birthdays query

This commit is contained in:
Skia 2018-09-19 11:37:16 +02:00
parent 09bde1bfdf
commit be36b7f38a

View File

@ -325,7 +325,7 @@ class NewsListView(CanViewMixin, ListView):
kwargs['timedelta'] = timedelta
kwargs['birthdays'] = User.objects\
.filter(date_of_birth__month=timezone.now().month, date_of_birth__day=timezone.now().day)\
.filter(role__in=['STUDENT', 'FORMER_STUDENT'])\
.filter(role__in=['STUDENT', 'FORMER STUDENT'])\
.order_by('-date_of_birth')
return kwargs