From 9ad62db7785c0e9b483a2aa2c118cc4a3308fd27 Mon Sep 17 00:00:00 2001 From: "Chris J. Karr" Date: Sun, 7 May 2017 06:40:51 +0000 Subject: [PATCH] Restructuring to avoid cicrular dependency in 3rd party deployments --- performance.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/performance.py b/performance.py index 7a27a58..a9797b4 100644 --- a/performance.py +++ b/performance.py @@ -8,11 +8,12 @@ import arrow -from django.conf import settings from django.utils import timezone def append_performance_sample(user, item, detail_date=timezone.now(), value=''): + from django.conf import settings + os.umask(000) today = datetime.date.today() @@ -42,6 +43,8 @@ def append_performance_sample(user, item, detail_date=timezone.now(), value=''): def fetch_performance_samples(user, item, start=None, end=None): + from django.conf import settings + if end is None: end = timezone.now() @@ -79,6 +82,8 @@ def fetch_performance_samples(user, item, start=None, end=None): def fetch_performance_users(): + from django.conf import settings + items_path = settings.MEDIA_ROOT + '/purple_robot_analytics/' users = {}