@@ -534,9 +534,9 @@ class EdxappEnrollment(UserQueryMixin, APIView):
534534 renderer_classes = (JSONRenderer , BrowsableAPIRenderer )
535535
536536 @apidocs .schema (
537- body = EdxappCourseEnrollmentSerializer ,
537+ body = EdxappCourseEnrollmentQuerySerializer ,
538538 responses = {
539- 200 : EdxappCourseEnrollmentSerializer ,
539+ 200 : EdxappCourseEnrollmentQuerySerializer ,
540540 202 : "User doesn't belong to site." ,
541541 400 : "Bad request, invalid course_id or missing either email or username." ,
542542 },
@@ -554,6 +554,7 @@ def post(self, request, *args, **kwargs):
554554 "username": "johndoe",
555555 "course_id": "course-v1:edX+DemoX+Demo_Course",
556556 "mode": "audit",
557+ "force": "False",
557558 "is_active": "False",
558559 "enrollment_attributes": [
559560 {
@@ -581,6 +582,11 @@ def post(self, request, *args, **kwargs):
581582 - `is_active` (boolean, _body_):
582583 Flag indicating whether the enrollment is active.
583584
585+ - `force` (boolean, _body_):
586+ Flag indicating whether the platform business rules for enrollment must be skipped. When it is true, the enrollment
587+ is created without looking at the enrollment dates, if the course is full, if the enrollment mode is part of the modes
588+ allowed by that course and other course settings.
589+
584590 - `enrollment_attributes` (list, _body_):
585591 List of enrollment attributes. An enrollment attribute can be used to add extra parameters for a specific course mode.
586592 It must be a dictionary containing the following:
@@ -597,6 +603,7 @@ def post(self, request, *args, **kwargs):
597603 "course_id": "course-v1:edX+DemoX+Demo_Course",
598604 "mode": "audit",
599605 "is_active": "False",
606+ "force": "False",
600607 "enrollment_attributes": [
601608 {
602609 "namespace": "credit",
@@ -610,6 +617,7 @@ def post(self, request, *args, **kwargs):
610617 "course_id": "course-v1:edX+DemoX+Demo_Course",
611618 "mode": "audit",
612619 "is_active": "True",
620+ "force": "False",
613621 "enrollment_attributes": []
614622 },
615623 ]
@@ -626,9 +634,9 @@ def post(self, request, *args, **kwargs):
626634 )
627635
628636 @apidocs .schema (
629- body = EdxappCourseEnrollmentSerializer ,
637+ body = EdxappCourseEnrollmentQuerySerializer ,
630638 responses = {
631- 200 : EdxappCourseEnrollmentSerializer ,
639+ 200 : EdxappCourseEnrollmentQuerySerializer ,
632640 202 : "User or enrollment doesn't belong to site." ,
633641 400 : "Bad request, invalid course_id or missing either email or username." ,
634642 },
0 commit comments