Changeset - 985a08545d05
[Not reviewed]
0 2 0
Ben Sturmfels (bsturmfels) - 4 months ago 2024-05-07 00:59:46
ben@sturm.com.au
Fix lint warnings
2 files changed with 2 insertions and 3 deletions:
0 comments (0 inline, 0 general)
TODO.md
Show inline comments
 
# To-do
 

	
 
* ensure appropriate caching headers are used
 
* remove jQuery
 
* consider removing `events` and `worldmap` modules
 
* ask Denver about why so many license files
 
* serve a 400 in Apache for a hostname we don't explicitly support
 
* use `<detail>` elements for supporter page hidden sections, rather than
 
  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
 

	
 
* split the template/content files out from `conservancy/static` into their own
 
  `content` directory (avoid mixing static and non-static content)
 
* remove `ForceCanonicalHostnameMiddleware` by ensuring canonical redirect and
 
  HTTPS redirect is done by Apache
 
* standardise settings to replace `settings.py` and `djangocommonsettings.py`
 
  with `settings/prod.py` and move `SECRET_KEY` to an environment variable
 
* migrate to Django 4.2 LTS
 
* review `apache2` directory - may be unused
conservancy/sponsors.py
Show inline comments
 
from datetime import datetime, timedelta
 
from datetime import datetime
 

	
 
from django.shortcuts import render
 

	
 
from .supporters.models import Supporter
 

	
 

	
 
def view(request):
 
    """Conservancy Sponsors Page view
 

	
 
    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')
 

	
 
    c = {
 
        'supporters' : supporters,
 
        'supporters_count' : supporters_count,
 
        'anonymous_count' : anonymous_count
 
    }
 
    return render(request, "sponsors.html", c)
0 comments (0 inline, 0 general)