##// END OF EJS Templates
action logger will try to get IP address automatically based...
marcink -
r4001:5ee34120 default
parent child Browse files
Show More
@@ -148,6 +148,11 b' def action_logger(user, action, repo, ip'
148
148
149 if not sa:
149 if not sa:
150 sa = meta.Session()
150 sa = meta.Session()
151 # if we don't get explicit IP address try to get one from registered user
152 # in tmpl context var
153 from pylons import tmpl_context
154 if not ipaddr and hasattr(tmpl_context, 'rhodecode_user'):
155 ipaddr = tmpl_context.rhodecode_user.ip_addr
151
156
152 try:
157 try:
153 if hasattr(user, 'user_id'):
158 if hasattr(user, 'user_id'):
@@ -160,7 +165,7 b' def action_logger(user, action, repo, ip'
160 if hasattr(repo, 'repo_id'):
165 if hasattr(repo, 'repo_id'):
161 repo_obj = Repository.get(repo.repo_id)
166 repo_obj = Repository.get(repo.repo_id)
162 repo_name = repo_obj.repo_name
167 repo_name = repo_obj.repo_name
163 elif isinstance(repo, basestring):
168 elif isinstance(repo, basestring):
164 repo_name = repo.lstrip('/')
169 repo_name = repo.lstrip('/')
165 repo_obj = Repository.get_by_repo_name(repo_name)
170 repo_obj = Repository.get_by_repo_name(repo_name)
166 else:
171 else:
General Comments 0
You need to be logged in to leave comments. Login now