today() is a function

Callables in querysets are deprecated, so make sure we don't end
up using them unintentionally...
This commit is contained in:
Magnus Hagander
2016-05-14 21:27:07 +02:00
parent 7c20836991
commit 59166227fd

View File

@ -40,7 +40,7 @@ from django.template.context import RequestContext
@cache(minutes=10)
def home(request):
news = NewsArticle.objects.filter(approved=True)[:7]
events = Event.objects.select_related('country').filter(approved=True, training=False, enddate__gte=date.today).order_by('enddate', 'startdate')[:5]
events = Event.objects.select_related('country').filter(approved=True, training=False, enddate__gte=date.today()).order_by('enddate', 'startdate')[:5]
try:
quote = Quote.objects.filter(approved=True).order_by('?')[0]
except: