From 8984fa8fceb79ffbff74f6bc640216502c769a9a Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Fri, 10 Dec 2010 08:29:34 +1100 Subject: [PATCH] dashboard: fix project tag filter R=rsc CC=golang-dev https://golang.org/cl/3439043 --- misc/dashboard/godashboard/package.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/misc/dashboard/godashboard/package.py b/misc/dashboard/godashboard/package.py index 27c51046e0f..e11346102d4 100644 --- a/misc/dashboard/godashboard/package.py +++ b/misc/dashboard/godashboard/package.py @@ -242,7 +242,11 @@ class ProjectPage(webapp.RequestHandler): self.list({"submitMsg": "Your project has been submitted."}) def list(self, additional_data={}): - data = memcache.get('view-project-data') + cache_key = 'view-project-data' + tag = self.request.get('tag', None) + if tag: + cache_key += '-'+tag + data = memcache.get(cache_key) admin = users.is_current_user_admin() if admin or not data: projects = Project.all().order('category').order('name') @@ -255,7 +259,6 @@ class ProjectPage(webapp.RequestHandler): for t in p.tags: tags.add(t) - tag = self.request.get('tag', None) if tag: projects = filter(lambda x: tag in x.tags, projects) @@ -265,7 +268,7 @@ class ProjectPage(webapp.RequestHandler): data['projects'] = projects data['admin']= admin if not admin: - memcache.set('view-project-data', data, time=CacheTimeout) + memcache.set(cache_key, data, time=CacheTimeout) for k, v in additional_data.items(): data[k] = v