File tree 1 file changed +6
-3
lines changed
misc/dashboard/godashboard 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -242,7 +242,11 @@ def post(self):
242
242
self .list ({"submitMsg" : "Your project has been submitted." })
243
243
244
244
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 )
246
250
admin = users .is_current_user_admin ()
247
251
if admin or not data :
248
252
projects = Project .all ().order ('category' ).order ('name' )
@@ -255,7 +259,6 @@ def list(self, additional_data={}):
255
259
for t in p .tags :
256
260
tags .add (t )
257
261
258
- tag = self .request .get ('tag' , None )
259
262
if tag :
260
263
projects = filter (lambda x : tag in x .tags , projects )
261
264
@@ -265,7 +268,7 @@ def list(self, additional_data={}):
265
268
data ['projects' ] = projects
266
269
data ['admin' ]= admin
267
270
if not admin :
268
- memcache .set ('view-project-data' , data , time = CacheTimeout )
271
+ memcache .set (cache_key , data , time = CacheTimeout )
269
272
270
273
for k , v in additional_data .items ():
271
274
data [k ] = v
You can’t perform that action at this time.
0 commit comments