Edit displaying rating and points rank for unlisted (#115)
* Edit displaying rating and points rank for unlisted * Edit rating/points rank of unlisted users and cache get_rank functions
This commit is contained in:
parent
570c3071ee
commit
46c950dc37
6 changed files with 25 additions and 19 deletions
|
@ -6,7 +6,10 @@ from judge.caching import cache_wrapper
|
|||
from judge.models import Profile, Rating, Submission, Friend, ProfileInfo
|
||||
|
||||
|
||||
@cache_wrapper(prefix="grr")
|
||||
def get_rating_rank(profile):
|
||||
if profile.is_unlisted:
|
||||
return None
|
||||
rank = None
|
||||
if profile.rating:
|
||||
rank = (
|
||||
|
@ -19,7 +22,10 @@ def get_rating_rank(profile):
|
|||
return rank
|
||||
|
||||
|
||||
@cache_wrapper(prefix="gpr")
|
||||
def get_points_rank(profile):
|
||||
if profile.is_unlisted:
|
||||
return None
|
||||
return (
|
||||
Profile.objects.filter(
|
||||
is_unlisted=False,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue