Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ptomasula committed Feb 29, 2024
2 parents 32a117f + 2919705 commit 5b3654e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"detail_link": "{% url 'site_detail' site.sampling_feature_code %}",
"dataType": "{% if site.latest_measurement%}EnviroDIY,{% endif %}{% if site.leafpack_count > 0 %}Leaf Pack,{% endif %}{% if site.streamwatch_count > 0 %}StreamWatch Schools,{% endif %}",
"status": "{{ site.ownership_status }}",
"dataAge":"{{ site.latest_measurement|data_age }}"
"dataAge":"{{ site.latest_measurement_utc|data_age }}"
}{% if not forloop.last %},{% endif %}
{% endfor %}
]
Expand Down
12 changes: 6 additions & 6 deletions src/dataloaderinterface/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ def get_site_data(self):
WITH last_measurement AS (
SELECT
ss."RegistrationID"
,MAX(sm.value_datetime + sm.value_datetime_utc_offset) AS latestmeasure
,MAX(sm.value_datetime) AS latestmeasure_utc
,MAX(sm.value_datetime_utc_offset) AS latestmeasure_utc_offset
,MAX(sm.value_datetime + sm.value_datetime_utc_offset) AS latestmeasurement
,MAX(sm.value_datetime) AS latestmeasurement_utc
,MAX(sm.value_datetime_utc_offset) AS latestmeasurement_utc_offset
FROM dataloaderinterface_sensormeasurement AS sm
JOIN dataloaderinterface_sitesensor AS ss
ON sm.sensor_id = ss.id
Expand Down Expand Up @@ -215,9 +215,9 @@ def get_site_data(self):
,sr."Latitude" AS latitude
,sr."Longitude" AS longitude
,sr."Elevation" AS elevation
,lm.latestmeasure_utc AS latest_measurement_utc
,lm.latestmeasure_utc_offset AS latest_measurement_utcoffset
,lm.latestmeasure AS latest_measurement
,lm.latestmeasurement_utc AS latest_measurement_utc
,lm.latestmeasurement_utc_offset AS latest_measurement_utcoffset
,lm.latestmeasurement AS latest_measurement
,lp.leafpack_count AS leafpack_count
,sr.streamwatch_assessments AS streamwatch_count
Expand Down

0 comments on commit 5b3654e

Please sign in to comment.