is_authenticated is now a @property

This commit is contained in:
Martin Pépin 2018-01-05 00:12:03 +01:00
parent 7549c5ce46
commit 8481874ad7

View file

@ -37,7 +37,7 @@ def calendar(request, pYear, pMonth):
lEvents = Event.objects.filter(date__gte=lCalendarFromMonth,
date__lte=lCalendarToMonth,
calendrier=True)
if request.user.is_authenticated():
if request.user.is_authenticated:
lEvents = Event.objects.filter(date__gte=lCalendarFromMonth,
date__lte=lCalendarToMonth)
lCalendar = EventCalendar(lEvents).formatmonth(lYear, lMonth)
@ -71,7 +71,7 @@ def calendar(request, pYear, pMonth):
def view_event(request, pYear, pMonth, id):
ev = get_object_or_404(Event, id=id)
if not request.user.is_authenticated() and not ev.calendrier:
if not request.user.is_authenticated and not ev.calendrier:
return redirect('calendrier.views.home')
nom = ev.nom.capitalize
fin = False
@ -89,7 +89,7 @@ def view_event(request, pYear, pMonth, id):
def view_eventbis(request, id):
ev = get_object_or_404(Event, id=id)
if not request.user.is_authenticated() and not ev.calendrier:
if not request.user.is_authenticated and not ev.calendrier:
return redirect('calendrier.views.home')
part = ev.participants_set.all()
nom = ev.nom.capitalize