From e9bae8bba8e0f0f50954187ed71a10b4507d774c Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Mon, 18 Mar 2013 18:20:45 -0700 Subject: [PATCH] Fixing log for non-requests. --- utils/log.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/utils/log.py b/utils/log.py index acfd99f52..d1c9808d2 100644 --- a/utils/log.py +++ b/utils/log.py @@ -49,10 +49,11 @@ def user(u, msg, request=None): "/reader/river_stories/", "/social/river_stories/" ] - path = MAnalyticsPageLoad.clean_path(request.path) - if request and path in page_load_paths: - MAnalyticsPageLoad.add(user=u, is_premium=is_premium, platform=platform, path=path, - duration=seconds) + if request: + path = MAnalyticsPageLoad.clean_path(request.path) + if path in page_load_paths: + MAnalyticsPageLoad.add(user=u, is_premium=is_premium, platform=platform, path=path, + duration=seconds) def cipher(msg): shift = len(msg)