misc: add back workflow data variables into into inspect page (#40414)
This commit is contained in:
parent
b1a6f621ed
commit
95d46c3910
|
@ -1500,8 +1500,19 @@ def test_webservice_call(http_requests, pub):
|
|||
assert formdata.workflow_data['xxx_status'] == 200
|
||||
assert formdata.workflow_data['xxx_response'] == {'foo': 'bar'}
|
||||
assert formdata.workflow_data.get('xxx_time')
|
||||
formdata.workflow_data = None
|
||||
|
||||
get_publisher().substitutions.reset()
|
||||
get_publisher().substitutions.feed(formdata)
|
||||
substvars = get_publisher().substitutions.get_context_variables(mode='lazy')
|
||||
assert str(substvars['xxx_status']) == '200'
|
||||
assert 'xxx_status' in substvars.get_flat_keys()
|
||||
assert str(substvars['xxx_response_foo']) == 'bar'
|
||||
assert 'xxx_response_foo' in substvars.get_flat_keys()
|
||||
|
||||
pub.substitutions.reset()
|
||||
pub.substitutions.feed(MockSubstitutionVariables())
|
||||
|
||||
formdata.workflow_data = None
|
||||
item = WebserviceCallStatusItem()
|
||||
item.url = 'http://remote.example.net'
|
||||
item.request_signature_key = 'xxx'
|
||||
|
|
|
@ -2632,7 +2632,6 @@ class FormBackOfficeStatusPage(FormStatusPage):
|
|||
|
||||
substvars = CompatibilityNamesDict()
|
||||
substvars.update(self.filled.get_substitution_variables())
|
||||
static_substvars = {}
|
||||
|
||||
def safe(v):
|
||||
if isinstance(v, str):
|
||||
|
@ -2648,6 +2647,9 @@ class FormBackOfficeStatusPage(FormStatusPage):
|
|||
return v
|
||||
|
||||
for k in sorted(substvars.get_flat_keys()):
|
||||
if k in ('attachments',):
|
||||
# blacklist, legacy
|
||||
continue
|
||||
k = safe(k)
|
||||
v = substvars[k]
|
||||
if isinstance(v, LazyFieldVar):
|
||||
|
|
|
@ -161,6 +161,7 @@ class CompatibilityNamesDict(dict):
|
|||
if not depth:
|
||||
return
|
||||
item = self[base]
|
||||
flat_keys[base] = item
|
||||
if hasattr(item, 'inspect_keys'):
|
||||
sub_keys = item.inspect_keys()
|
||||
elif isinstance(item, dict):
|
||||
|
|
Loading…
Reference in New Issue