Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
8ac8f6a8
Commit
8ac8f6a8
authored
Jun 03, 2017
by
Luuk Scholten
Browse files
Make calls to calendarjs api accesible to unauthorized users
parent
d87d920f
Changes
1
Hide whitespace changes
Inline
Side-by-side
website/events/api/viewsets.py
View file @
8ac8f6a8
...
@@ -5,7 +5,11 @@ from rest_framework import viewsets, filters
...
@@ -5,7 +5,11 @@ from rest_framework import viewsets, filters
from
rest_framework.decorators
import
list_route
,
detail_route
from
rest_framework.decorators
import
list_route
,
detail_route
from
rest_framework.exceptions
import
ParseError
from
rest_framework.exceptions
import
ParseError
from
rest_framework.generics
import
get_object_or_404
from
rest_framework.generics
import
get_object_or_404
from
rest_framework.permissions
import
IsAuthenticated
,
IsAdminUser
from
rest_framework.permissions
import
(
IsAuthenticated
,
IsAdminUser
,
IsAuthenticatedOrReadOnly
)
from
rest_framework.response
import
Response
from
rest_framework.response
import
Response
from
events.api.permissions
import
UnpublishedEventPermissions
from
events.api.permissions
import
UnpublishedEventPermissions
...
@@ -81,7 +85,7 @@ class EventViewset(viewsets.ReadOnlyModelViewSet):
...
@@ -81,7 +85,7 @@ class EventViewset(viewsets.ReadOnlyModelViewSet):
return
Response
(
serializer
.
data
)
return
Response
(
serializer
.
data
)
@
list_route
(
permission_classes
=
[]
)
@
list_route
(
permission_classes
=
(
IsAuthenticatedOrReadOnly
,)
)
def
calendarjs
(
self
,
request
):
def
calendarjs
(
self
,
request
):
end
,
start
=
_extract_date_range
(
request
)
end
,
start
=
_extract_date_range
(
request
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment