Commit 11ca80c3 authored by cst's avatar cst
Browse files

handle empty data

parent eab3d0f1
......@@ -42,6 +42,8 @@ class ObservationHandler:
values = []
for oc in ids:
v = list(filter(lambda x: x.OCId == oc, observations))
if len(v) == 0:
t = v[0]
data = [{"datetime": d.DateTime, "val": d.Val} for d in v]
o = {"station": t.Station, "component": t.Component, "unit": t.Unit, "timestep": t.Timestep, "values": data}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment