Handle time vs ts field in data
This commit is contained in:
parent
6eea7f1965
commit
66dc57dc45
|
@ -198,12 +198,18 @@ def query_results(request, size=None):
|
||||||
element["id"] = item["_id"]
|
element["id"] = item["_id"]
|
||||||
|
|
||||||
# Split the timestamp into date and time
|
# Split the timestamp into date and time
|
||||||
ts = element["ts"]
|
if "ts" not in element:
|
||||||
ts_spl = ts.split("T")
|
if "time" in element: # will fix data later
|
||||||
date = ts_spl[0]
|
ts = element["time"]
|
||||||
time = ts_spl[1]
|
del element["time"]
|
||||||
element["date"] = date
|
element["ts"] = ts
|
||||||
element["time"] = time
|
if "ts" in element:
|
||||||
|
ts = element["ts"]
|
||||||
|
ts_spl = ts.split("T")
|
||||||
|
date = ts_spl[0]
|
||||||
|
time = ts_spl[1]
|
||||||
|
element["date"] = date
|
||||||
|
element["time"] = time
|
||||||
results_parsed.append(element)
|
results_parsed.append(element)
|
||||||
|
|
||||||
annotate_results(results_parsed)
|
annotate_results(results_parsed)
|
||||||
|
|
Loading…
Reference in New Issue