Show More
@@ -148,6 +148,11 b' def action_logger(user, action, repo, ip' | |||
|
148 | 148 | |
|
149 | 149 | if not sa: |
|
150 | 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 | 157 | try: |
|
153 | 158 | if hasattr(user, 'user_id'): |
@@ -160,7 +165,7 b' def action_logger(user, action, repo, ip' | |||
|
160 | 165 | if hasattr(repo, 'repo_id'): |
|
161 | 166 | repo_obj = Repository.get(repo.repo_id) |
|
162 | 167 | repo_name = repo_obj.repo_name |
|
163 |
elif |
|
|
168 | elif isinstance(repo, basestring): | |
|
164 | 169 | repo_name = repo.lstrip('/') |
|
165 | 170 | repo_obj = Repository.get_by_repo_name(repo_name) |
|
166 | 171 | else: |
General Comments 0
You need to be logged in to leave comments.
Login now