Caching and refactors
This commit is contained in:
parent
67b06d7856
commit
8f1c8d6c96
33 changed files with 485 additions and 381 deletions
|
@ -155,16 +155,14 @@ def item_title(item):
|
|||
|
||||
@registry.function
|
||||
@registry.render_with("user/link.html")
|
||||
def link_user(user):
|
||||
def link_user(user, show_image=False):
|
||||
if isinstance(user, Profile):
|
||||
profile = user
|
||||
elif isinstance(user, AbstractUser):
|
||||
profile = user.profile
|
||||
elif type(user).__name__ == "ContestRankingProfile":
|
||||
profile = user
|
||||
else:
|
||||
raise ValueError("Expected profile or user, got %s" % (type(user),))
|
||||
return {"profile": profile}
|
||||
return {"profile": profile, "show_image": show_image}
|
||||
|
||||
|
||||
@registry.function
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue