##// END OF EJS Templates
Speed up tags ordering in the navigation panel.
neko259 -
r149:71e2d696 default
parent child Browse files
Show More
@@ -308,6 +308,9 b' class User(models.Model):'
308 def is_moderator(self):
308 def is_moderator(self):
309 return RANK_MODERATOR >= self.rank
309 return RANK_MODERATOR >= self.rank
310
310
311 def get_sorted_fav_tags(self):
312 return self.fav_tags.order_by('name')
313
311 def __unicode__(self):
314 def __unicode__(self):
312 return self.user_id + '(' + self.rank + ')'
315 return self.user_id + '(' + self.rank + ')'
313
316
@@ -292,7 +292,7 b' def _init_default_context(request):'
292
292
293 user = _get_user(request)
293 user = _get_user(request)
294 context['user'] = user
294 context['user'] = user
295 context['tags'] = sorted(user.fav_tags.all(), key=lambda tag: tag.name)
295 context['tags'] = user.get_sorted_fav_tags()
296 context['theme'] = _get_theme(request, user)
296 context['theme'] = _get_theme(request, user)
297
297
298 return context
298 return context
General Comments 0
You need to be logged in to leave comments. Login now