Changeset - 5ee341209d7f
[Not reviewed]
default
0 1 0
Marcin Kuzminski - 12 years ago 2013-06-15 22:51:32
marcin@python-works.com
action logger will try to get IP address automatically based
on tmpl_context var (if defined)
1 file changed with 5 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/utils.py
Show inline comments
 
@@ -148,6 +148,11 @@ def action_logger(user, action, repo, ip
 

	
 
    if not sa:
 
        sa = meta.Session()
 
    # if we don't get explicit IP address try to get one from registered user
 
    # in tmpl context var
 
    from pylons import tmpl_context
 
    if not ipaddr and hasattr(tmpl_context, 'rhodecode_user'):
 
        ipaddr = tmpl_context.rhodecode_user.ip_addr
 

	
 
    try:
 
        if hasattr(user, 'user_id'):
0 comments (0 inline, 0 general)