diff --git a/backend/api/exercices/views.py b/backend/api/exercices/views.py index 6380d4e8..68083ddf 100644 --- a/backend/api/exercices/views.py +++ b/backend/api/exercices/views.py @@ -73,8 +73,8 @@ class ExerciceAPI(APIView): try: exo = Exercice.objects.get(id_code=code) except: - exo = None return Response({'error': "Not found"}, status= status.HTTP_404_NOT_FOUND) + isUser = False if request.user == exo.author: isUser = True