Skip to content

Commit

Permalink
Merge pull request #177 from ractf/hotfix/disable-challenge-server
Browse files Browse the repository at this point in the history
Fix shell displaying disabled challenge server
  • Loading branch information
david-cooke authored Aug 12, 2021
2 parents 0bfd9a6 + 8a16c36 commit d45c8ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/andromeda/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from rest_framework.generics import get_object_or_404
from rest_framework.permissions import IsAdminUser, IsAuthenticated
from rest_framework.status import HTTP_400_BAD_REQUEST
from rest_framework.status import HTTP_403_FORBIDDEN
from rest_framework.views import APIView

from andromeda import client
Expand All @@ -16,7 +16,7 @@ class GetInstanceView(APIView):

def get(self, request, job_id):
if not config.get("enable_challenge_server"):
return FormattedResponse(m="challenge_server_disabled", status=HTTP_400_BAD_REQUEST)
return FormattedResponse(m="challenge_server_disabled", status=HTTP_403_FORBIDDEN)
return FormattedResponse(client.get_instance(request.user.id, job_id))


Expand All @@ -26,7 +26,7 @@ class ResetInstanceView(APIView):

def get(self, request, job_id):
if not config.get("enable_challenge_server"):
return FormattedResponse(m="challenge_server_disabled", status=HTTP_400_BAD_REQUEST)
return FormattedResponse(m="challenge_server_disabled", status=HTTP_403_FORBIDDEN)
return FormattedResponse(client.request_reset(request.user.id, job_id))


Expand Down

0 comments on commit d45c8ce

Please sign in to comment.