Skip to content

Commit

Permalink
Don't validate serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebrownlee committed Jul 23, 2024
1 parent 001e789 commit 28c8275
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions LearningAPI/views/student_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,7 @@ def list(self, request):

serializer = CohortStudentSerializer(data=students, many=True)

if serializer.is_valid():
return Response(serializer.data, status=status.HTTP_200_OK)
else:
return Response({'message': serializer.error_messages}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
return Response(serializer.data, status=status.HTTP_200_OK)

@action(methods=['post', 'put'], detail=True)
def assess(self, request, pk):
Expand Down Expand Up @@ -560,8 +557,8 @@ class Meta:

class CohortStudentSerializer(serializers.Serializer):
"""JSON serializer"""
id = serializers.IntegerField()
github_handle = serializers.CharField(max_length=100)
id = serializers.IntegerField()
name = serializers.CharField(max_length=100)
current_cohort = serializers.DictField()
avatar = serializers.CharField(allow_blank=True, allow_null=True)
Expand Down

0 comments on commit 28c8275

Please sign in to comment.