Browse Source

Fix metrics requests timezone to be TIME_ZONE from settings

Denis K 9 years ago
parent
commit
33aedcf705

+ 2 - 2
jet/dashboard/dashboard_modules/google_analytics.py

@@ -282,8 +282,8 @@ class GoogleAnalyticsBase(DashboardModule):
 
     def api_ga(self, group=None):
         if self.counter_attached():
-            date1 = datetime.datetime.utcnow() - datetime.timedelta(days=self.period)
-            date2 = datetime.datetime.utcnow()
+            date1 = datetime.datetime.now() - datetime.timedelta(days=self.period)
+            date2 = datetime.datetime.now()
 
             try:
                 client = GoogleAnalyticsClient(self.storage)

+ 2 - 2
jet/dashboard/dashboard_modules/yandex_metrika.py

@@ -224,8 +224,8 @@ class YandexMetrikaBase(DashboardModule):
 
     def api_stat_traffic_summary(self, group=None):
         if self.counter_attached():
-            date1 = datetime.datetime.utcnow() - datetime.timedelta(days=self.period)
-            date2 = datetime.datetime.utcnow()
+            date1 = datetime.datetime.now() - datetime.timedelta(days=self.period)
+            date2 = datetime.datetime.now()
 
             client = YandexMetrikaClient(self.access_token)
             result, exception = client.api_stat_traffic_summary(self.counter, date1, date2, group)