Show More
@@ -26,11 +26,14 | |||
|
26 | 26 | # MA 02110-1301, USA. |
|
27 | 27 | |
|
28 | 28 | import logging |
|
29 | ||
|
29 | 30 | from pylons import request, tmpl_context as c |
|
31 | from sqlalchemy.orm import joinedload | |
|
32 | from webhelpers.paginate import Page | |
|
33 | ||
|
34 | from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator | |
|
30 | 35 | from rhodecode.lib.base import BaseController, render |
|
31 | 36 | from rhodecode.model.db import UserLog |
|
32 | from webhelpers.paginate import Page | |
|
33 | from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator | |
|
34 | 37 | |
|
35 | 38 | log = logging.getLogger(__name__) |
|
36 | 39 | |
@@ -43,7 +46,11 class AdminController(BaseController): | |||
|
43 | 46 | @HasPermissionAllDecorator('hg.admin') |
|
44 | 47 | def index(self): |
|
45 | 48 | |
|
46 |
users_log = self.sa.query(UserLog) |
|
|
49 | users_log = self.sa.query(UserLog)\ | |
|
50 | .options(joinedload(UserLog.user))\ | |
|
51 | .options(joinedload(UserLog.repository))\ | |
|
52 | .order_by(UserLog.action_date.desc()) | |
|
53 | ||
|
47 | 54 | p = int(request.params.get('page', 1)) |
|
48 | 55 | c.users_log = Page(users_log, page=p, items_per_page=10) |
|
49 | 56 | c.log_data = render('admin/admin_log.html') |
@@ -600,7 +600,7 class HasPermissionAnyMiddleware(object) | |||
|
600 | 600 | |
|
601 | 601 | def check_permissions(self): |
|
602 | 602 | log.debug('checking mercurial protocol ' |
|
603 | 'permissions for user:%s repository:%s', | |
|
603 | 'permissions %s for user:%s repository:%s', self.user_perms, | |
|
604 | 604 | self.username, self.repo_name) |
|
605 | 605 | if self.required_perms.intersection(self.user_perms): |
|
606 | 606 | log.debug('permission granted') |
@@ -441,9 +441,8 def action_parser(user_log): | |||
|
441 | 441 | revs = action_params.split(',') |
|
442 | 442 | repo_name = user_log.repository.repo_name |
|
443 | 443 | from rhodecode.model.scm import ScmModel |
|
444 | ||
|
445 |
message = lambda rev: get_changeset_safe( |
|
|
446 | rev).message | |
|
444 | repo, dbrepo = ScmModel().get(repo_name, retval='repo') | |
|
445 | message = lambda rev: get_changeset_safe(repo, rev).message | |
|
447 | 446 | |
|
448 | 447 | cs_links = " " + ', '.join ([link_to(rev, |
|
449 | 448 | url('changeset_home', |
General Comments 0
You need to be logged in to leave comments.
Login now