0001-backoffice-reorder-webservice-parameters-71565.patch
wcs/templates/wcs/backoffice/wscall.html | ||
---|---|---|
17 | 17 |
<div class="bo-block"> |
18 | 18 |
<h3>{% trans "Parameters" %}</h3> |
19 | 19 |
<ul> |
20 |
<li>{% trans "Method:" %} {% if wscall.request.method == 'POST' %}POST{% else %}GET{% endif %}</li> |
|
20 | 21 |
{% if wscall.request.url %}<li>{% trans "URL:" %} {{ wscall.request.url }}</li>{% endif %} |
21 |
{% if wscall.request.request_signature_key %}<li>{% trans "Request Signature Key:" %} {{ wscall.request.request_signature_key }}</li>{% endif %} |
|
22 | 22 |
{% if wscall.request.qs_data %} |
23 | 23 |
<li>{% trans "Query string data:" %} |
24 | 24 |
<ul> |
... | ... | |
28 | 28 |
</ul> |
29 | 29 |
</li> |
30 | 30 |
{% endif %} |
31 |
<li>{% trans "Method:" %} {% if wscall.request.method == 'POST' %}POST{% else %}GET{% endif %}</li> |
|
31 |
{% if wscall.request.request_signature_key %} |
|
32 |
<li>{% trans "Request Signature Key:" %} {{ wscall.request.request_signature_key }}</li> |
|
33 |
{% endif %} |
|
32 | 34 |
{% if wscall.request.timeout %} |
33 | 35 |
<li>{% trans "Timeout:" %} {{ wscall.request.timeout }}s</li> |
34 | 36 |
{% endif %} |
wcs/wf/wscall.py | ||
---|---|---|
171 | 171 |
def get_parameters(self): |
172 | 172 |
return ( |
173 | 173 |
'label', |
174 |
'method', |
|
174 | 175 |
'url', |
175 |
'request_signature_key', |
|
176 | 176 |
'qs_data', |
177 |
'method', |
|
178 | 177 |
'post', |
179 | 178 |
'post_data', |
180 | 179 |
'response_type', |
181 | 180 |
'varname', |
181 |
'request_signature_key', |
|
182 | 182 |
'backoffice_filefield_id', |
183 | 183 |
'action_on_app_error', |
184 | 184 |
'action_on_4xx', |
wcs/wscalls.py | ||
---|---|---|
319 | 319 |
if not value: |
320 | 320 |
value = {} |
321 | 321 | |
322 |
self.add(StringWidget, 'url', title=_('URL'), value=value.get('url'), size=80) |
|
323 |
self.add( |
|
324 |
ComputedExpressionWidget, |
|
325 |
'request_signature_key', |
|
326 |
title=_('Request Signature Key'), |
|
327 |
value=value.get('request_signature_key'), |
|
328 |
) |
|
329 |
self.add( |
|
330 |
WidgetDict, |
|
331 |
'qs_data', |
|
332 |
title=_('Query string data'), |
|
333 |
value=value.get('qs_data') or {}, |
|
334 |
element_value_type=ComputedExpressionWidget, |
|
335 |
allow_empty_values=True, |
|
336 |
value_for_empty_value='', |
|
337 |
) |
|
338 | 322 |
methods = collections.OrderedDict( |
339 | 323 |
[ |
340 | 324 |
('GET', _('GET')), |
... | ... | |
354 | 338 |
extra_css_class='widget-inline-radio', |
355 | 339 |
) |
356 | 340 |
method_widget = self.get_widget('method') |
341 |
self.add(StringWidget, 'url', title=_('URL'), value=value.get('url'), size=80) |
|
342 |
self.add( |
|
343 |
WidgetDict, |
|
344 |
'qs_data', |
|
345 |
title=_('Query string data'), |
|
346 |
value=value.get('qs_data') or {}, |
|
347 |
element_value_type=ComputedExpressionWidget, |
|
348 |
allow_empty_values=True, |
|
349 |
value_for_empty_value='', |
|
350 |
) |
|
351 | ||
357 | 352 |
if self.include_post_formdata: |
358 | 353 |
self.add( |
359 | 354 |
CheckboxWidget, |
... | ... | |
379 | 374 |
}, |
380 | 375 |
) |
381 | 376 | |
377 |
self.add( |
|
378 |
ComputedExpressionWidget, |
|
379 |
'request_signature_key', |
|
380 |
title=_('Request Signature Key'), |
|
381 |
value=value.get('request_signature_key'), |
|
382 |
) |
|
383 | ||
382 | 384 |
def validate_timeout(value): |
383 | 385 |
if value and not value.isdecimal(): |
384 | 386 |
raise ValueError(_('Timeout must be empty or a number.')) |
385 |
- |