misc: add support for HTTP provisionning (#43245)
This commit is contained in:
parent
b68ea5b38d
commit
eb33406b9a
10
wcs/api.py
10
wcs/api.py
|
@ -24,7 +24,7 @@ from quixote.directory import Directory
|
|||
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.six.moves.urllib import parse as urllib
|
||||
from django.http import HttpResponse, HttpResponseBadRequest
|
||||
from django.http import HttpResponse, HttpResponseBadRequest, JsonResponse
|
||||
|
||||
from .qommon import _
|
||||
from .qommon import misc
|
||||
|
@ -918,3 +918,11 @@ def validate_condition(request, *args, **kwargs):
|
|||
hint['klass'] = 'error'
|
||||
hint['msg'] = str(e)
|
||||
return HttpResponse(json.dumps(hint), content_type='application/json')
|
||||
|
||||
|
||||
def provisionning(request):
|
||||
if not is_url_signed():
|
||||
raise AccessForbiddenError()
|
||||
from wcs.ctl.hobo_notify import CmdHoboNotify
|
||||
CmdHoboNotify().process_notification(get_request().json)
|
||||
return JsonResponse({'err': 0})
|
||||
|
|
|
@ -24,6 +24,7 @@ urlpatterns = [
|
|||
url(r'^robots.txt$', views.robots_txt),
|
||||
url(r'^backoffice/', views.backoffice),
|
||||
|
||||
url(r'^__provision__/$', api.provisionning),
|
||||
url(r'^api/validate-condition$', api.validate_condition, name='api-validate-condition'),
|
||||
url(r'^api/validate-expression$', api.validate_expression, name='api-validate-expression'),
|
||||
url(r'^api/reverse-geocoding$', api.reverse_geocoding, name='api-reverse-geocoding'),
|
||||
|
|
Loading…
Reference in New Issue