diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-05-25 19:34:21 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-05-25 19:34:21 -0400 |
commit | 1a1fd4a3d6aa7f6b2338f7751f5f97a30a059a04 (patch) | |
tree | f608874663d24f19ecf175ec556f2a330d47a726 /mirrors/views.py | |
parent | 747a562ddca10e29dd003e8b3c59f8f384d1bc8d (diff) | |
parent | cd7222047b41ac3efa389a22fdd22148d03c1d61 (diff) |
Merge tag 'release_2014-03-22' into archweb-generic
Fix long filenames; local storage for filter prefs
Conflicts:
templates/public/download.html
Diffstat (limited to 'mirrors/views.py')
-rw-r--r-- | mirrors/views.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mirrors/views.py b/mirrors/views.py index 34336165..26b5b802 100644 --- a/mirrors/views.py +++ b/mirrors/views.py @@ -11,7 +11,8 @@ from django.http import Http404, HttpResponse from django.shortcuts import get_object_or_404, redirect, render from django.utils.timezone import now from django.views.decorators.csrf import csrf_exempt -from django_countries.countries import COUNTRIES +from django.views.decorators.http import condition +from django_countries.data import COUNTRIES from .models import (Mirror, MirrorUrl, MirrorProtocol, MirrorLog, CheckLocation) @@ -220,6 +221,11 @@ def url_details(request, name, url_id): return render(request, 'mirrors/url_details.html', context) +def status_last_modified(request, *args, **kwargs): + return MirrorLog.objects.values_list('check_time', flat=True).latest() + + +@condition(last_modified_func=status_last_modified) def status(request, tier=None): if tier is not None: tier = int(tier) @@ -297,6 +303,7 @@ class ExtendedMirrorStatusJSONEncoder(MirrorStatusJSONEncoder): return super(ExtendedMirrorStatusJSONEncoder, self).default(obj) +@condition(last_modified_func=status_last_modified) def status_json(request, tier=None): if tier is not None: tier = int(tier) |