home · contact · privacy
Fix week reset.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 17 Jan 2023 23:47:17 +0000 (00:47 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 17 Jan 2023 23:47:17 +0000 (00:47 +0100)
income_progress_bars.py

index 48b1179430326ec4ea1c26ef29a0801b30974fa2..8a85a4c5a7402ff791a47a033678f1f6c352d1f7 100644 (file)
@@ -1,4 +1,3 @@
-# Python 3 server example
 from http.server import BaseHTTPRequestHandler, HTTPServer
 import os
 import json
@@ -215,7 +214,9 @@ class MyServer(BaseHTTPRequestHandler):
             success = success_income + 0
             diff_goal = earned - goal 
             if time_progress >= 0:
-                success = success_income / time_progress
+                success = 1
+                if time_progress > 0:
+                    success = success_income / time_progress
                 time_progress_indicator = "<div class=\"time_progress\" style=\"margin-left: %spx\"></div>" % int(time_progress * 100) 
             return "<tr><th>%s</th>" \
                     "<td class=\"countable\">%.2f€</td>" \