diff --git a/services/operation_services.py b/services/operation_services.py index c8f27a2239d4832ee44c51503d6d1d0540d16e13..7b2183b7d322ad228fa324f707b222fa35039a27 100644 --- a/services/operation_services.py +++ b/services/operation_services.py @@ -100,7 +100,7 @@ class OperationsService(Component): cons_rate = round((power_tot[2] / power_tot[1]) * 100, 2) prod_rate = round((power_tot[2] / power_tot[0]) * 100, 2) except Exception: - power_tot = (0, 0) + power_tot = (0, 0, 0, None) cons_rate = prod_rate = 0 nb_conso = ( @@ -709,7 +709,7 @@ class OperationsService(Component): "image": {"type": "string", "nullable": True}, "conso_tot": {"type": "float"}, "prod_tot": {"type": "float"}, - "month": {"type": "date"}, + "month": {"type": "date", "nullable": True}, "conso_rate": {"type": "float"}, "prod_rate": {"type": "float"}, "news": {