0003-workflows-remove-now-unused-support-for-custom-escap.patch
wcs/workflows.py | ||
---|---|---|
2391 | 2391 |
register_item_class(SendmailWorkflowStatusItem) |
2392 | 2392 | |
2393 | 2393 | |
2394 |
def get_formdata_template_context(formdata=None, process=None): |
|
2395 |
ctx = {} |
|
2396 |
ctx.update(get_publisher().substitutions.get_context_variables()) |
|
2394 |
def get_formdata_template_context(formdata=None): |
|
2395 |
ctx = get_publisher().substitutions.get_context_variables() |
|
2397 | 2396 |
if formdata: |
2398 | 2397 |
ctx['url'] = formdata.get_url() |
2399 | 2398 |
ctx['url_status'] = '%sstatus' % formdata.get_url() |
... | ... | |
2411 | 2410 |
ctx['after'] = ctx.get('form_status') |
2412 | 2411 |
ctx['evolution'] = ctx.get('form_evolution') |
2413 | 2412 | |
2414 |
if process: |
|
2415 |
for key in ctx: |
|
2416 |
ctx[key] = process(ctx[key]) |
|
2417 | ||
2418 | 2413 |
charset = get_publisher().site_charset |
2419 | 2414 |
for k, v in ctx.items(): |
2420 | 2415 |
if isinstance(v, unicode): |
... | ... | |
2426 | 2421 |
return template_on_formdata(None, template, ezt_format=ezt.FORMAT_HTML) |
2427 | 2422 | |
2428 | 2423 | |
2429 |
def template_on_formdata(formdata=None, template=None, process=None, |
|
2430 |
**kwargs): |
|
2424 |
def template_on_formdata(formdata=None, template=None, **kwargs): |
|
2431 | 2425 |
assert template is not None |
2432 | 2426 |
if not Template.is_template_string(template): |
2433 | 2427 |
# no tags, no variables: don't even process formdata |
2434 | 2428 |
return template |
2435 |
context = get_formdata_template_context(formdata, process=process)
|
|
2429 |
context = get_formdata_template_context(formdata) |
|
2436 | 2430 |
return template_on_context(context, template, **kwargs) |
2437 | 2431 | |
2438 | 2432 | |
2439 |
- |