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