renderer: remove usage of old non request PartialRenderer

This commit is contained in:
Marcin Kuzminski 2017-07-24 09:59:48 +02:00
parent 72eb573560
commit 3b524b7875
5 changed files with 8 additions and 8 deletions

View file

@ -126,7 +126,7 @@ class AdminUsersView(BaseAppView, DataGridAppView):
users_data = []
for user in users_list:
users_data.append({
"username": h.gravatar_with_user(user.username),
"username": h.gravatar_with_user(self.request, user.username),
"email": user.email,
"first_name": user.first_name,
"last_name": user.last_name,

View file

@ -923,9 +923,8 @@ def person_by_id(id_, show_attr="username_and_name"):
return id_
def gravatar_with_user(author, show_disabled=False):
from rhodecode.lib.utils import PartialRenderer
_render = PartialRenderer('base/base.mako')
def gravatar_with_user(request, author, show_disabled=False):
_render = request.get_partial_renderer('base/base.mako')
return _render('gravatar_with_user', author, show_disabled=show_disabled)

View file

@ -442,7 +442,7 @@ class ScmModel(BaseModel):
f_path = os.path.normpath(f_path)
return f_path
def get_dirnode_metadata(self, commit, dir_node):
def get_dirnode_metadata(self, request, commit, dir_node):
if not dir_node.is_dir():
return []
@ -463,7 +463,8 @@ class ScmModel(BaseModel):
'short_id': last_commit.short_id,
'message': h.escape(last_commit.message),
'author': h.escape(last_commit.author),
'user_profile': h.gravatar_with_user(last_commit.author),
'user_profile': h.gravatar_with_user(
request, last_commit.author),
})
return data

View file

@ -18,7 +18,7 @@
<td class="cb-annotate-info tooltip"
title="Author: ${tooltip(annotation.author) | entity}<br>Date: ${annotation.date}<br>Message: ${annotation.message | entity}"
>
${h.gravatar_with_user(annotation.author, 16) | n}
${h.gravatar_with_user(request, annotation.author, 16) | n}
<div class="cb-annotate-message truncate-wrap">${h.chop_at_smart(annotation.message, '\n', suffix_if_chopped='...')}</div>
</td>
<td class="cb-annotate-message-spacer">

View file

@ -65,7 +65,7 @@
</td>
<td class="td-user" data-attr-name="author">
% if c.full_load:
<span data-author="${node.last_commit.author}" title="${h.tooltip(node.last_commit.author)}">${h.gravatar_with_user(node.last_commit.author)|n}</span>
<span data-author="${node.last_commit.author}" title="${h.tooltip(node.last_commit.author)}">${h.gravatar_with_user(request, node.last_commit.author)|n}</span>
% endif
</td>
%else: