base adresse: return a "bad request" if it's missing parameters (#8544)
This commit is contained in:
parent
15a9f0c61a
commit
a3c2d56853
|
@ -3,7 +3,7 @@ import urllib
|
|||
import urlparse
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.http import Http404
|
||||
from django.http import Http404, HttpResponseBadRequest
|
||||
from django.shortcuts import redirect
|
||||
from django.views.generic.base import View, RedirectView
|
||||
from django.views.generic.detail import SingleObjectMixin, DetailView
|
||||
|
@ -69,6 +69,10 @@ class ReverseView(View, SingleObjectMixin):
|
|||
response_format = request.GET['format']
|
||||
if response_format != 'json':
|
||||
raise NotImplementedError()
|
||||
|
||||
if not 'lat' in request.GET or not 'lon' in request.GET:
|
||||
return HttpResponseBadRequest('missing parameter')
|
||||
|
||||
lat = request.GET['lat']
|
||||
lon = request.GET['lon']
|
||||
|
||||
|
|
Loading…
Reference in New Issue