make API read-only

This commit is contained in:
Tao Bojlen 2018-08-27 12:58:11 +02:00
parent f7a8c1fe57
commit d55d437369

View file

@ -3,8 +3,8 @@ from scraper.models import Instance
from apiv1.serializers import InstanceListSerializer, InstanceDetailSerializer from apiv1.serializers import InstanceListSerializer, InstanceDetailSerializer
class InstanceViewSet(viewsets.ModelViewSet): class InstanceViewSet(viewsets.ReadOnlyModelViewSet):
"""API endpoint to view instances""" """API endpoint to view stats for, and the peers of, an instance"""
lookup_field = 'name' lookup_field = 'name'
lookup_value_regex = '[a-zA-Z0-9-_\.]+' lookup_value_regex = '[a-zA-Z0-9-_\.]+'