Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changing repsonse codes to 403 for authentication errors

  • Loading branch information...
commit 792dc75c51cb897830dd16d286a45302972662c3 1 parent 07a8c77
@brez brez authored
Showing with 5 additions and 4 deletions.
  1. +3 −3 ffdemo/markup/requests.py
  2. +2 −1  ffdemo/markup/views.py
View
6 ffdemo/markup/requests.py
@@ -169,7 +169,7 @@ def delete_mark(request):
if not request.user.is_authenticated():
response['error'] = _('Authentication required')
json_response = simplejson.dumps(response)
- return HttpResponseServerError(json_response, 'application/json')
+ return HttpResponseForbidden(json_response, 'application/json')
else:
if 'reference' in request.POST and len(request.POST['reference']) > 0:
try:
@@ -194,7 +194,7 @@ def delete_all_based_on_ip(request):
if not request.user.is_authenticated():
response['error'] = _('Authentication required')
json_response = simplejson.dumps(response)
- return HttpResponseServerError(json_response, 'application/json')
+ return HttpResponseForbidden(json_response, 'application/json')
else:
if 'ip' in request.POST and len(request.POST['ip']) > 0:
try:
@@ -219,7 +219,7 @@ def approve_mark(request):
if not request.user.is_authenticated():
response['error'] = _('Authentication required')
json_response = simplejson.dumps(response)
- return HttpResponseServerError(json_response, 'application/json')
+ return HttpResponseForbidden(json_response, 'application/json')
else:
if 'reference' in request.POST and len(request.POST['reference']) > 0:
try:
View
3  ffdemo/markup/views.py
@@ -32,7 +32,8 @@ def home(request):
@cache_page(60 * 30) # cache for 30 minutes
def about(request):
return render_response(request, 'about.html')
-
+
+
@cache_page(60 * 30) # cache for 30 minutes
def coming_soon(request):
return render_response(request, 'coming_soon.html')
Please sign in to comment.
Something went wrong with that request. Please try again.