From 41d1e00e5e97cdd35378fdab7305ac8c908e9693 Mon Sep 17 00:00:00 2001 From: Iago Veloso Date: Sun, 25 Jun 2017 16:00:18 +0100 Subject: [PATCH] Fixing progress bar --- docs/source/upgrade/3.2.rst | 2 ++ radioco/apps/radioco/views.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/source/upgrade/3.2.rst b/docs/source/upgrade/3.2.rst index 0916ed2..928066c 100755 --- a/docs/source/upgrade/3.2.rst +++ b/docs/source/upgrade/3.2.rst @@ -14,6 +14,7 @@ What's new in 3.2 * Adding cache to singleton models using memcached * Improve performance `in staging config `_ using nginx cache, uwsgi and caching templates * Updating Spanish and Galician translations +* Fixing progress bar in the main page ******************** @@ -45,6 +46,7 @@ You should be able to keep your current database but make sure to create a backu .. code-block:: bash + python manage.py collectstatic python manage.py migrate diff --git a/radioco/apps/radioco/views.py b/radioco/apps/radioco/views.py index 0f7d595..2062e6a 100755 --- a/radioco/apps/radioco/views.py +++ b/radioco/apps/radioco/views.py @@ -37,9 +37,9 @@ def index(request): try: live_transmission = transmissions_between.next() if live_transmission.start <= now < live_transmission.end: - percentage = round( + percentage = int(round( (now - live_transmission.start).total_seconds() / - (live_transmission.end - live_transmission.start).total_seconds() * 100) + (live_transmission.end - live_transmission.start).total_seconds() * 100)) else: next_transmissions.append(live_transmission) live_transmission = None