forked from openedx/edx-platform
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* stv/enrollment-api/remove-post: Remove POST from enrollment/roster API
- Loading branch information
Showing
1 changed file
with
0 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,32 +77,6 @@ def get(self, request, course_id=None): | |
roster = get_roster(course_id) | ||
return Response(data=json.dumps({'roster': roster})) | ||
|
||
@method_decorator(ensure_csrf_cookie_cross_domain) | ||
def post(self, request, course_id): | ||
""" | ||
Enroll/unenroll a user in a course; requires staff access | ||
**Example Request** | ||
POST /api/enrollment/v1/roster/course-v1:foo+bar+foobar | ||
{ | ||
'email': '[email protected]', | ||
'action': 'enroll', | ||
'email_students': false, | ||
'auto_enroll': true | ||
} | ||
""" | ||
action = request.data.get('action') | ||
if action == 'enroll': | ||
return self.put(request, course_id) | ||
if action == 'unenroll': | ||
return self.delete(request, course_id) | ||
return Response( | ||
status=status.HTTP_400_BAD_REQUEST, | ||
data={ | ||
'message': u'Unrecognized action', | ||
}, | ||
) | ||
|
||
def put(self, request, course_id): | ||
""" | ||
Enroll a user in a course; requires staff access | ||
|