[extensions-web] update-info: return HTTP/400 instead of empty json on wrong input



commit d6dc5aa51a8cb819d933f76f2037e4e4366aeb18
Author: Yuri Konotopov <ykonotopov gnome org>
Date:   Wed Feb 15 00:34:41 2017 +0400

    update-info: return HTTP/400 instead of empty json on wrong input

 sweettooth/extensions/views.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/sweettooth/extensions/views.py b/sweettooth/extensions/views.py
index 16bd1f9..a43c9e0 100644
--- a/sweettooth/extensions/views.py
+++ b/sweettooth/extensions/views.py
@@ -8,7 +8,7 @@ from django.core.urlresolvers import reverse
 from django.contrib.auth.decorators import login_required
 from django.contrib import messages
 from django.db import transaction
-from django.http import HttpResponseForbidden, HttpResponseServerError, Http404
+from django.http import HttpResponseBadRequest, HttpResponseForbidden, HttpResponseServerError, Http404
 from django.shortcuts import get_object_or_404, redirect, render
 from django.template.loader import render_to_string
 from django.views.decorators.http import require_POST
@@ -87,7 +87,7 @@ def shell_update(request):
         installed = json.loads(request.GET['installed'])
         shell_version = request.GET['shell_version']
     except (KeyError, ValueError):
-        return {}
+        return HttpResponseBadRequest()
 
     operations = {}
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]