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
4bc9cb4d
Commit
4bc9cb4d
authored
Aug 31, 2015
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9531 from edx/credit-api-csrf-fix
Diabled CSRF protection for Credit Course API endpoints
parents
ab2d0063
a1ba77d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
openedx/core/djangoapps/credit/views.py
+4
-0
No files found.
openedx/core/djangoapps/credit/views.py
View file @
4bc9cb4d
...
...
@@ -12,6 +12,7 @@ from django.http import (
HttpResponseForbidden
,
Http404
)
from
django.utils.decorators
import
method_decorator
from
django.views.decorators.csrf
import
csrf_exempt
from
django.views.decorators.http
import
require_POST
,
require_GET
from
opaque_keys
import
InvalidKeyError
...
...
@@ -379,6 +380,9 @@ class CreditCourseViewSet(mixins.CreateModelMixin, mixins.UpdateModelMixin, view
authentication_classes
=
(
authentication
.
OAuth2Authentication
,
authentication
.
SessionAuthentication
,)
permission_classes
=
(
permissions
.
IsAuthenticated
,
permissions
.
IsAdminUser
)
# This CSRF exemption only applies when authenticating without SessionAuthentication.
# SessionAuthentication will enforce CSRF protection.
@method_decorator
(
csrf_exempt
)
def
dispatch
(
self
,
request
,
*
args
,
**
kwargs
):
# Convert the course ID/key from a string to an actual CourseKey object.
course_id
=
kwargs
.
get
(
self
.
lookup_field
,
None
)
...
...
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