Changing response type for easier debugging
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Fri, 8 Nov 2013 13:38:50 +0000 (14:38 +0100)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 15 Jan 2014 10:18:58 +0000 (11:18 +0100)
wtem/views.py

index 896746a..c49298d 100644 (file)
@@ -3,7 +3,7 @@ import os
 from django.shortcuts import render
 from django.utils import simplejson
 from django.conf import settings
-from django.http import Http404
+from django.http import Http404, HttpResponseForbidden
 
 from .models import Submission, DEBUG_KEY
 from .forms import WTEMForm
@@ -24,7 +24,7 @@ def form_during(request, key):
 
     if WTEM_CONTEST_STAGE != 'during':
         if request.META['REMOTE_ADDR'] != getattr(settings, 'WTEM_CONTEST_IP_ALLOW', 'xxx'):
-            raise Http404
+            return HttpResponseForbidden('Not allowed')
 
     try:
         submission = Submission.objects.get(key = key)