From 47520e958eb40848de6b7fe4dbf1b5876a075af9 Mon Sep 17 00:00:00 2001 From: anon Date: Tue, 2 Aug 2022 21:58:48 -0300 Subject: [PATCH] fixed bug on views from sfmodel loading time --- charts/templates/charts/index.html | 12 ++++++------ charts/views.py | 21 ++++++++------------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/charts/templates/charts/index.html b/charts/templates/charts/index.html index afe6887..6161efa 100644 --- a/charts/templates/charts/index.html +++ b/charts/templates/charts/index.html @@ -97,17 +97,17 @@

Morpheus - May 11, 25 contributions > + May 11, 35 contributions >

- (manual update) Raised 10.31 of 46 XMR + (manual update) Raised 11.01 of 46 XMR

-
+
@@ -135,17 +135,17 @@

Morpheus - May 11, 25 contributions > + May 11, 35 contributions >

- (manual update) Raised 10.31 of 46 XMR + (manual update) Raised 11.01 of 46 XMR

-
+
diff --git a/charts/views.py b/charts/views.py index 927cd87..624e1e5 100644 --- a/charts/views.py +++ b/charts/views.py @@ -3727,7 +3727,6 @@ def sfmodel(request): update_visitors(False) dt = datetime.datetime.now(timezone.utc).timestamp() - update = False today = datetime.datetime.strftime(date.today(), '%Y-%m-%d') @@ -3742,23 +3741,19 @@ def sfmodel(request): print('no need to update') update = False else: - print('need to update, coin has missing parameters') - now = datetime.datetime.now() - current_time = int(now.strftime("%H")) - if current_time >= 5: - coin.delete() - #coin_aux.delete() - update = True - else: - update = False + coin.delete() + update = True else: - print('no coin found yesterday') + print('no coin found yesterday - 1') update = True except: - print('no coin found yesterday') + print('no coin found yesterday - 2') update = True - if update: + now = datetime.datetime.now() + current_time = int(now.strftime("%H")) + + if update and (current_time >= 5): print('social') check_new_social('Bitcoin') check_new_social('Monero')