summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-12-22 21:50:58 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-12-22 21:50:58 -0500
commit2bfec5b17ca3ee3ea3b347c029b9d8dad3c5b4d0 (patch)
tree6bda86f6489fbdfdce67d282b20586fc6032735b /public
parent3579e3cb34a53abd16da3af78be738c2a4dd0d5c (diff)
parent36f5e1df9afbeac1d04fee38dde4c28f81144a20 (diff)
Merge tag 'release_2013-12-19' into archweb-generic
Mirror URL page, other random stuff
Diffstat (limited to 'public')
-rw-r--r--public/utils.py3
-rw-r--r--public/views.py8
2 files changed, 6 insertions, 5 deletions
diff --git a/public/utils.py b/public/utils.py
index fcfd0f77..11091883 100644
--- a/public/utils.py
+++ b/public/utils.py
@@ -2,7 +2,7 @@ from collections import defaultdict
from operator import attrgetter
from main.models import Arch, Repo, Package
-from main.utils import cache_function, groupby_preserve_order, PackageStandin
+from main.utils import groupby_preserve_order, PackageStandin
class RecentUpdate(object):
def __init__(self, packages):
@@ -58,7 +58,6 @@ class RecentUpdate(object):
return "RecentUpdate '%s %s' <%d packages>" % (
self.pkgbase, self.version, len(self.packages))
-@cache_function(62)
def get_recent_updates(number=15, testing=True, staging=False):
repos = Repo.objects.all()
if not testing:
diff --git a/public/views.py b/public/views.py
index a5f818dc..d1661afd 100644
--- a/public/views.py
+++ b/public/views.py
@@ -20,12 +20,14 @@ from .utils import get_recent_updates
@cache_control(max_age=300)
def index(request):
if request.user.is_authenticated():
- pkgs = get_recent_updates(testing=True, staging=True)
+ def updates():
+ return get_recent_updates(testing=True, staging=True)
else:
- pkgs = get_recent_updates()
+ def updates():
+ return get_recent_updates()
context = {
'news_updates': News.objects.order_by('-postdate', '-id')[:15],
- 'pkg_updates': pkgs,
+ 'pkg_updates': updates,
}
return render(request, 'public/index.html', context)