Skip to content

Commit

Permalink
Merge pull request #85 from HE-Arc/mbu-84-return-false-but-no-error-t…
Browse files Browse the repository at this point in the history
…o-options_asked

return false if no question
  • Loading branch information
maelys-buhler authored Apr 9, 2024
2 parents 4969e8e + 848575d commit dfa0af3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/masteriqapp/views/QuestionView.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def answer_options(self, request):
@action(detail=False, methods=["GET"])
def options_asked(self, request):
if not 'question' in request.session or not 'options_asked' in request.session:
return Response(status=449, data={"error": "No question being answered at the moment"})
data_to_send = {"options_asked": request.session['options_asked']}
data_to_send = {"options_asked": False}
else:
data_to_send = {"options_asked": request.session['options_asked']}
return Response(status=status.HTTP_200_OK, data=data_to_send)

0 comments on commit dfa0af3

Please sign in to comment.