mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
fix localdate issues
This commit is contained in:
committed by
Bartuccio Antoine
parent
271d57051e
commit
0eaa20e09d
@ -34,6 +34,7 @@ from django.http import HttpResponseRedirect
|
||||
from django.shortcuts import get_object_or_404, redirect
|
||||
from django.urls import reverse, reverse_lazy
|
||||
from django.utils import timezone
|
||||
from django.utils.timezone import localdate
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.views.generic import DetailView, ListView, View
|
||||
from django.views.generic.detail import SingleObjectMixin
|
||||
@ -381,8 +382,8 @@ 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,
|
||||
date_of_birth__month=localdate().month,
|
||||
date_of_birth__day=localdate().day,
|
||||
)
|
||||
.filter(role__in=["STUDENT", "FORMER STUDENT"])
|
||||
.order_by("-date_of_birth")
|
||||
|
Reference in New Issue
Block a user