Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rename view names.

Add IsAuthenticated permission class.
  • Loading branch information...
commit 1c8556fe9172e8e59b3d2ab8861177d1bf53d135 1 parent d13fe54
@markotibold markotibold authored
Showing with 6 additions and 3 deletions.
  1. +2 −2 fiber/rest_api/serializers.py
  2. +4 −1 fiber/rest_api/views.py
View
4 fiber/rest_api/serializers.py
@@ -9,7 +9,7 @@
class PageSerializer(serializers.ModelSerializer):
- move_url = serializers.HyperlinkedIdentityField(view_name='page-resource-instance-move')
+ move_url = serializers.HyperlinkedIdentityField(view_name='page-move')
page_url = serializers.Field(source='get_absolute_url')
class Meta:
@@ -22,7 +22,7 @@ class MovePageSerializer(serializers.Serializer):
class PageContentItemSerializer(serializers.ModelSerializer):
- move_url = serializers.HyperlinkedIdentityField(view_name='page-content-item-resource-instance-move')
+ move_url = serializers.HyperlinkedIdentityField(view_name='pagecontentitem-move')
class Meta:
model = PageContentItem
View
5 fiber/rest_api/views.py
@@ -1,11 +1,13 @@
from django.db.models import Q
-from rest_framework import generics, renderers
+from rest_framework import generics
+from rest_framework import renderers
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework import views
from rest_framework import status
+from rest_framework import permissions
from fiber.models import Page, PageContentItem, ContentItem, File, Image
from fiber.app_settings import API_RENDER_HTML, PERMISSION_CLASS
@@ -38,6 +40,7 @@ class PageList(FiberListCreateAPIView):
model = Page
serializer_class = PageSerializer
renderer_classes = API_RENDERERS
+ permission_classes = (permissions.IsAuthenticated,)
class PageDetail(generics.RetrieveUpdateDestroyAPIView):
Please sign in to comment.
Something went wrong with that request. Please try again.