Skip to content

Commit 8984fa8

Browse files
committed
dashboard: fix project tag filter
R=rsc CC=golang-dev https://golang.org/cl/3439043
1 parent e3b6188 commit 8984fa8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

misc/dashboard/godashboard/package.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,11 @@ def post(self):
242242
self.list({"submitMsg": "Your project has been submitted."})
243243

244244
def list(self, additional_data={}):
245-
data = memcache.get('view-project-data')
245+
cache_key = 'view-project-data'
246+
tag = self.request.get('tag', None)
247+
if tag:
248+
cache_key += '-'+tag
249+
data = memcache.get(cache_key)
246250
admin = users.is_current_user_admin()
247251
if admin or not data:
248252
projects = Project.all().order('category').order('name')
@@ -255,7 +259,6 @@ def list(self, additional_data={}):
255259
for t in p.tags:
256260
tags.add(t)
257261

258-
tag = self.request.get('tag', None)
259262
if tag:
260263
projects = filter(lambda x: tag in x.tags, projects)
261264

@@ -265,7 +268,7 @@ def list(self, additional_data={}):
265268
data['projects'] = projects
266269
data['admin']= admin
267270
if not admin:
268-
memcache.set('view-project-data', data, time=CacheTimeout)
271+
memcache.set(cache_key, data, time=CacheTimeout)
269272

270273
for k, v in additional_data.items():
271274
data[k] = v

0 commit comments

Comments
 (0)