Skip to content

Commit

Permalink
Resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
proffalken committed Oct 22, 2023
1 parent 4fc2a7f commit 09638a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/SPACEDIRECTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ curl -X POST -H 'Authorization: Token <response from above>' \

### Adding Sensor Data

[Sensors](https://spaceapi.io/docs/#schema-key-sensors) are a really cool part of the SpaceAPI schema, as it allows you to publish all kinds of things from how many drinks are still in teh fridge through to environment readings such as temperature, windspeed, and humidity.
[Sensors](https://spaceapi.io/docs/#schema-key-sensors) are a really cool part of the SpaceAPI schema, as it allows you to publish all kinds of things from how many drinks are still in the fridge through to environment readings such as temperature, windspeed, and humidity.

By default, MemberMatters exposes the total number of active members and how many have "signed in" to the space, however you can add your own sensors as long as they conform to the appropriate type.

Expand Down
4 changes: 2 additions & 2 deletions memberportal/api_spacedirectory/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from rest_framework.response import Response
from rest_framework import status, permissions
from rest_framework_api_key.permissions import HasAPIKey
from rest_framework.views import APIView
from constance import config
from .models import SpaceAPI, SpaceAPISensor, SpaceAPISensorProperties
Expand Down Expand Up @@ -121,7 +122,7 @@ def get(self, request):
class SpaceDirectoryUpdate(APIView):
"""Allows authenticated users to update the SpaceAPI information"""

permissions_classes = permissions.IsAuthenticated
permissions_classes = permissions.IsAuthenticated | HasAPIKey

def post(self, request):
# Get the current state of the space
Expand Down Expand Up @@ -182,7 +183,6 @@ def post(self, request):

current_sensor.save()
except Exception as e:
print(e)
new_sensor = SpaceAPISensor()
new_sensor.sensor_type = sensor["type"]
new_sensor.name = sensor["name"]
Expand Down

0 comments on commit 09638a3

Please sign in to comment.