0001-api-include-backoffice-submission-url-when-asked-256.patch
tests/test_api.py | ||
---|---|---|
469 | 469 |
local_user.name_identifiers[0])) |
470 | 470 |
assert resp.json['err'] == 0 |
471 | 471 |
assert len(resp.json['data']) == 1 |
472 |
assert 'backoffice_submission_url' in resp.json['data'][0] |
|
472 | 473 | |
473 | 474 |
# but not advertised if it's a redirection |
474 | 475 |
formdef.disabled = True |
wcs/api.py | ||
---|---|---|
409 | 409 |
'authentication_required': authentication_required} |
410 | 410 |
if formdef.required_authentication_contexts: |
411 | 411 |
formdict['required_authentication_contexts'] = formdef.required_authentication_contexts |
412 |
if backoffice_submission: |
|
413 |
formdict['backoffice_submission_url'] = formdef.get_backoffice_submission_url() |
|
412 | 414 | |
413 | 415 |
formdict['redirection'] = bool(formdef.is_disabled() and |
414 | 416 |
formdef.disabled_redirection) |
wcs/formdef.py | ||
---|---|---|
505 | 505 |
base_url = get_publisher().get_frontoffice_url() |
506 | 506 |
return '%s/api/forms/%s/' % (base_url, self.url_name) |
507 | 507 | |
508 |
def get_backoffice_submission_url(self): |
|
509 |
base_url = get_publisher().get_backoffice_url() + '/submission' |
|
510 |
return '%s/%s/' % (base_url, self.url_name) |
|
511 | ||
508 | 512 |
def get_display_id_format(self): |
509 | 513 |
return '[formdef_id]-[form_number_raw]' |
510 | 514 | |
511 |
- |