Fix small bug in api_varnish_purge error path
authorMarti Raudsepp <marti@juffo.org>
Wed, 7 Nov 2012 21:14:21 +0000 (23:14 +0200)
committerMagnus Hagander <magnus@hagander.net>
Sun, 11 Nov 2012 15:07:40 +0000 (16:07 +0100)
HttpServerError is a function that returns HttpResponse, not an
exception.

pgweb/core/views.py

index 96848466ec58c8ee6a8230783b59947cd1f858ea..854bf9389d3d1651de9a9d8312714364fcbeb5b9 100644 (file)
@@ -213,7 +213,7 @@ def api_varnish_purge(request):
        if not request.META['REMOTE_ADDR'] in settings.VARNISH_PURGERS:
                return HttpServerError("Invalid client address")
        if request.method != 'POST':
-               raise HttpServerError("Can't use this way")
+               return HttpServerError("Can't use this way")
        n = int(request.POST['n'])
        curs = connection.cursor()
        for i in range(0, n):