From 985a08545d05492642288f0a277d0124b943a998 Mon Sep 17 00:00:00 2001 From: Ben Sturmfels Date: Tue, 7 May 2024 10:59:34 +1000 Subject: [PATCH] Fix lint warnings --- TODO.md | 1 + conservancy/sponsors.py | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/TODO.md b/TODO.md index 1ea2031a..d59858f0 100644 --- a/TODO.md +++ b/TODO.md @@ -9,6 +9,7 @@ complex jQuery - or consider Alpine.js * replace `internalNavigate` with inline flexbox layout * add tests for main pages returning 200 +* move `sponsors.py` and `sponsors.html` into `supporters` app # Done diff --git a/conservancy/sponsors.py b/conservancy/sponsors.py index 845d5609..549b9c4b 100644 --- a/conservancy/sponsors.py +++ b/conservancy/sponsors.py @@ -1,4 +1,4 @@ -from datetime import datetime, timedelta +from datetime import datetime from django.shortcuts import render @@ -10,12 +10,10 @@ def view(request): Performs object queries necessary to render the sponsors page. """ - supporters = Supporter.objects.all().filter(display_until_date__gte=datetime.now()) supporters_count = len(supporters) - anonymous_count = len(supporters.filter(display_name = 'Anonymous')) - supporters = supporters.exclude(display_name = 'Anonymous').order_by('ledger_entity_id') - + anonymous_count = len(supporters.filter(display_name='Anonymous')) + supporters = supporters.exclude(display_name='Anonymous').order_by('ledger_entity_id') c = { 'supporters' : supporters, 'supporters_count' : supporters_count,