comparison rhodecode/controllers/changeset.py @ 2375:bc2d8c03c050 beta

Implemented #467 Journal logs comments on changesets - added created/updated user action to journal - added created/updated users group action journal - added ip adresses to most of action_log calls to track IP changes - rewrote action_parser to simpler and more efficient solution
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 03 Jun 2012 00:40:14 +0200
parents 5143b8df576c
children 91fae60bf2b6
comparison
equal deleted inserted replaced
2374:be2163ef127e 2375:bc2d8c03c050
38 from rhodecode.lib.vcs.nodes import FileNode 38 from rhodecode.lib.vcs.nodes import FileNode
39 39
40 import rhodecode.lib.helpers as h 40 import rhodecode.lib.helpers as h
41 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator 41 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
42 from rhodecode.lib.base import BaseRepoController, render 42 from rhodecode.lib.base import BaseRepoController, render
43 from rhodecode.lib.utils import EmptyChangeset 43 from rhodecode.lib.utils import EmptyChangeset, action_logger
44 from rhodecode.lib.compat import OrderedDict 44 from rhodecode.lib.compat import OrderedDict
45 from rhodecode.lib import diffs 45 from rhodecode.lib import diffs
46 from rhodecode.model.db import ChangesetComment 46 from rhodecode.model.db import ChangesetComment
47 from rhodecode.model.comment import ChangesetCommentsModel 47 from rhodecode.model.comment import ChangesetCommentsModel
48 from rhodecode.model.meta import Session 48 from rhodecode.model.meta import Session
371 user_id=c.rhodecode_user.user_id, 371 user_id=c.rhodecode_user.user_id,
372 revision=revision, 372 revision=revision,
373 f_path=request.POST.get('f_path'), 373 f_path=request.POST.get('f_path'),
374 line_no=request.POST.get('line') 374 line_no=request.POST.get('line')
375 ) 375 )
376 action_logger(self.rhodecode_user,
377 'user_commented_revision:%s' % revision,
378 c.rhodecode_db_repo, self.ip_addr, self.sa)
379
376 Session.commit() 380 Session.commit()
381
377 if not request.environ.get('HTTP_X_PARTIAL_XHR'): 382 if not request.environ.get('HTTP_X_PARTIAL_XHR'):
378 return redirect(h.url('changeset_home', repo_name=repo_name, 383 return redirect(h.url('changeset_home', repo_name=repo_name,
379 revision=revision)) 384 revision=revision))
380 385
381 data = { 386 data = {