Skip to content

Commit

Permalink
chore: fixing quality.
Browse files Browse the repository at this point in the history
  • Loading branch information
awais786 committed Sep 20, 2024
1 parent e0066d0 commit a98d398
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lms/djangoapps/instructor/views/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3052,7 +3052,7 @@ def post(self, request, course_id):
student (str): The email or username of the student whose access is being modified.
reason (str): Optional param.
"""
serializer_data = self.serializer_class(data=request.data, context={'make_due_datetime': True})
serializer_data = self.serializer_class(data=request.data, context={'disable_due_datetime': True})
if not serializer_data.is_valid():
return HttpResponseBadRequest(reason=serializer_data.errors)

Expand Down
4 changes: 2 additions & 2 deletions lms/djangoapps/instructor/views/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def validate_student(self, value):

def __init__(self, *args, **kwargs):
# Get context to check if `due_datetime` should be optional
make_due_datetime = kwargs.get('context', {}).get('make_due_datetime', False)
disable_due_datetime = kwargs.get('context', {}).get('disable_due_datetime', False)
super().__init__(*args, **kwargs)
if make_due_datetime:
if disable_due_datetime:
self.fields['due_datetime'].required = False

0 comments on commit a98d398

Please sign in to comment.