Commit 6f6e376c authored by Rafal's avatar Rafal

update

parent 979b183a
...@@ -41,7 +41,10 @@ class UuidBeaconViewSet(APIView): ...@@ -41,7 +41,10 @@ class UuidBeaconViewSet(APIView):
serializer_class = BeaconSerializer serializer_class = BeaconSerializer
def get(self, request, pk, category_name = None,format=None): def get(self, request, pk, category_name = None,format=None):
beacon = Beacon.objects.get(uuid = pk) try:
beacon = Beacon.objects.get(uuid = pk)
except ObjectDoesNotExist:
return Response(status=rest_framework.status.HTTP_400_BAD_REQUEST, data={"This beacon is not exist"})
beacon_manager = BeaconManager.objects.get(beacon=beacon) beacon_manager = BeaconManager.objects.get(beacon=beacon)
if category_name: if category_name:
try: try:
......
Markdown is supported
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