Show all events to logged-in users

This commit is contained in:
Martin Pépin 2020-09-12 19:05:16 +02:00
parent 8d3805a922
commit c3f9b26aea
No known key found for this signature in database
GPG key ID: E7520278B1774448

View file

@ -55,9 +55,9 @@ def calendar(request, pYear, pMonth):
lMonth = int(pMonth)
lCalendarFromMonth = datetime(lYear, lMonth, 1)
lCalendarToMonth = datetime(lYear, lMonth, monthrange(lYear, lMonth)[1])
lEvents = Event.objects.filter(date__gte=lCalendarFromMonth,
date__lte=lCalendarToMonth,
calendrier="F")
lEvents = Event.objects.filter(
date__gte=lCalendarFromMonth, date__lte=lCalendarToMonth
)
if request.user.is_authenticated:
lEvents = Event.objects.filter(date__gte=lCalendarFromMonth,
date__lte=lCalendarToMonth)