Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
8c411041
Commit
8c411041
authored
Jun 11, 2014
by
Matt Drayer
Committed by
Jonathan Piacenti
Aug 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mattdrayer/api-secureapiview-fix: Resolved DRF view issue
parent
08acaad8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
lms/djangoapps/api_manager/permissions.py
+6
-2
lms/djangoapps/api_manager/users/views.py
+2
-2
No files found.
lms/djangoapps/api_manager/permissions.py
View file @
8c411041
...
...
@@ -5,7 +5,7 @@ from django.conf import settings
from
api_manager.utils
import
get_client_ip_address
,
address_exists_in_network
from
rest_framework
import
permissions
,
generics
,
filters
,
pagination
,
serializers
from
rest_framework.views
import
APIView
log
=
logging
.
getLogger
(
__name__
)
...
...
@@ -102,7 +102,11 @@ class CustomPaginationSerializer(pagination.PaginationSerializer):
num_pages
=
serializers
.
Field
(
source
=
'paginator.num_pages'
)
class
SecureAPIView
(
generics
.
ListAPIView
):
class
SecureAPIView
(
APIView
):
permission_classes
=
(
ApiKeyHeaderPermission
,
)
class
SecureListAPIView
(
generics
.
ListAPIView
):
"""
Inherited from ListAPIView
"""
...
...
lms/djangoapps/api_manager/users/views.py
View file @
8c411041
...
...
@@ -13,7 +13,7 @@ from rest_framework.response import Response
from
django.db.models
import
Q
from
api_manager.permissions
import
SecureAPIView
from
api_manager.permissions
import
SecureAPIView
,
SecureListAPIView
from
api_manager.models
import
GroupProfile
from
.serializers
import
UserSerializer
...
...
@@ -114,7 +114,7 @@ def _save_content_position(request, user, course_id, course_descriptor, position
return
saved_content
.
id
class
UsersList
(
SecureAPIView
):
class
UsersList
(
Secure
List
APIView
):
"""
### The UsersList view allows clients to retrieve/append a list of User entities
- URI: ```/api/users/```
...
...
Write
Preview
Markdown
is supported
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