Skip to content

Commit 2504aff

Browse files
authored
Ensure data is return from public sensors only (#120)
1 parent f717d52 commit 2504aff

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sensorsafrica/api/v2/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ def list(self, request):
160160
stats = (
161161
SensorDataValue.objects.filter(
162162
Q(sensordata__sensor__node=last_active.node.id),
163+
# Open endpoints should return data from public sensors
164+
# only.
165+
Q(sensordata__sensor__public=True),
163166
Q(sensordata__location=last_active.location.id),
164167
Q(sensordata__timestamp__gte=last_5_mins),
165168
Q(sensordata__timestamp__lte=last_data_received_at),

0 commit comments

Comments
 (0)