Verified Commit 66f4cf30 authored by Luuk Scholten's avatar Luuk Scholten Committed by Sébastiaan Versteeg
Browse files

Fix PEP8 failures

parent 5a333d8d
...@@ -8,8 +8,12 @@ from rest_framework.decorators import list_route ...@@ -8,8 +8,12 @@ from rest_framework.decorators import list_route
from rest_framework.permissions import IsAuthenticated, IsAdminUser from rest_framework.permissions import IsAuthenticated, IsAdminUser
from events.api.permissions import UnpublishedEventPermissions from events.api.permissions import UnpublishedEventPermissions
from events.api.serializers import EventCalenderJSSerializer, UnpublishedEventSerializer, \ from events.api.serializers import (
EventRetrieveSerializer, EventListSerializer EventCalenderJSSerializer,
UnpublishedEventSerializer,
EventRetrieveSerializer,
EventListSerializer
)
from events.models import Event from events.models import Event
...@@ -27,7 +31,8 @@ def _extract_date_range(request): ...@@ -27,7 +31,8 @@ def _extract_date_range(request):
class EventViewset(viewsets.ReadOnlyModelViewSet): class EventViewset(viewsets.ReadOnlyModelViewSet):
queryset = Event.objects.filter(end__gte=timezone.datetime.now(), published=True) queryset = Event.objects.filter(
end__gte=timezone.datetime.now(), published=True)
permission_classes = [IsAuthenticated] permission_classes = [IsAuthenticated]
def get_serializer_class(self): def get_serializer_class(self):
...@@ -48,7 +53,7 @@ class EventViewset(viewsets.ReadOnlyModelViewSet): ...@@ -48,7 +53,7 @@ class EventViewset(viewsets.ReadOnlyModelViewSet):
) )
serializer = EventCalenderJSSerializer(queryset, many=True, serializer = EventCalenderJSSerializer(queryset, many=True,
context={'user': request.user}) context={'user': request.user})
return Response(serializer.data) return Response(serializer.data)
@list_route(permission_classes=(IsAdminUser, UnpublishedEventPermissions,)) @list_route(permission_classes=(IsAdminUser, UnpublishedEventPermissions,))
......
Supports Markdown
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