Skip to content

Commit

Permalink
feat: upgrading simple api to drf compatible.
Browse files Browse the repository at this point in the history
  • Loading branch information
awais786 committed Aug 8, 2024
1 parent c91fd97 commit 9d586b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lms/djangoapps/instructor/views/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,10 @@ class ModifyAccess(APIView):

@method_decorator(ensure_csrf_cookie)
def post(self, request, course_id):

"""
Modify staff/instructor access of other user.
Requires instructor access.
"""
course_id = CourseKey.from_string(course_id)
course = get_course_with_access(
request.user, 'instructor', course_id, depth=None
Expand Down
6 changes: 5 additions & 1 deletion lms/djangoapps/instructor/views/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from django.utils.translation import gettext as _
from rest_framework import serializers
from .tools import get_student_from_identifier
from common.djangoapps.util.json_request import JsonResponse

from lms.djangoapps.instructor.access import ROLES

Expand Down Expand Up @@ -33,6 +32,11 @@ class Meta:


class AccessSerializer(serializers.Serializer):
"""
Serializer for managing user access changes.
This serializer validates and processes the data required to modify
user access within a system.
"""
unique_student_identifier = serializers.CharField(
max_length=255,
help_text="Email or username of user to change access"
Expand Down

0 comments on commit 9d586b7

Please sign in to comment.