Skip to content

Commit

Permalink
Only use CKAN_CURRENT_URL if it is there
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Jun 23, 2016
1 parent 5734465 commit 2776cf1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ckan/config/middleware/flask_app.py
Expand Up @@ -129,10 +129,11 @@ def ckan_after_request(response):
response = set_cors_headers_for_response(response)

# log time between before and after view
r_time = time.time() - c._request_timer
url = request.environ['CKAN_CURRENT_URL'].split('?')[0]
log.info('{url} render time {r_time:.3f} seconds'.format(
url=url, r_time=r_time))
if request.environ.get('CKAN_CURRENT_URL'):
r_time = time.time() - c._request_timer
url = request.environ['CKAN_CURRENT_URL'].split('?')[0]
log.info('{url} render time {r_time:.3f} seconds'.format(
url=url, r_time=r_time))
return response

# Template context processors
Expand Down

0 comments on commit 2776cf1

Please sign in to comment.