From 7c191c06ccf400e7a96a88b68ac1bceb6160cf67 Mon Sep 17 00:00:00 2001 From: Tor-Einar Skog <tor-einar.skog@nibio.no> Date: Mon, 27 Jun 2022 12:13:49 +0200 Subject: [PATCH] Handling NULL values in charts --- forecasts/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forecasts/models.py b/forecasts/models.py index e6a53135..731375b5 100755 --- a/forecasts/models.py +++ b/forecasts/models.py @@ -155,7 +155,7 @@ class ForecastResult: the_value = forecast_result.all_values.get(result_parameter.getNamespaceKey(), "") if the_value != "" and timeseries.get(result_parameter.getNamespaceKey(), None) != None: try: - data_point = [util.get_unix_timestamp(forecast_result.valid_time_start),Decimal(the_value)] + data_point = [util.get_unix_timestamp(forecast_result.valid_time_start),Decimal(the_value) if the_value is not None else None] timeseries[result_parameter.getNamespaceKey()]["data"].append(data_point) except InvalidOperation: continue -- GitLab