Changeset - fca73608c2ba
[Not reviewed]
0 1 0
Ben Sturmfels (bsturmfels) - 2 years ago 2021-10-13 10:20:58
ben@sturm.com.au
Count supporters in the database - it's faster.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
www/conservancy/frontpage.py
Show inline comments
...
 
@@ -13,7 +13,7 @@ def view(request):
 
    now = datetime.now()
 
    context = {
 
        'press_releases': PressRelease.objects.all().filter(pub_date__lte=now, sites=2)[:5],
 
        'supporters_count': len(Supporter.objects.all().filter(display_until_date__gte=now)),
 
        'supporters_count': Supporter.objects.all().filter(display_until_date__gte=now).count(),
 
        'blog': BlogEntry.objects.all().filter(pub_date__lte=now)[:5],
 
    }
 
    return render_template_with_context(request, "frontpage.html", context)
0 comments (0 inline, 0 general)