api: always return id as strings (#54447)

This commit is contained in:
Frédéric Péters 2021-05-31 21:14:57 +02:00
parent 8d80ecbedb
commit 523ff3ab98
1 changed files with 4 additions and 4 deletions

View File

@ -167,7 +167,7 @@ class ApiFormdataPage(FormStatusPage):
self.formdata.jump_status(item.status)
self.formdata.perform_workflow()
return json.dumps({'err': 0, 'data': {'id': self.formdata.id}})
return json.dumps({'err': 0, 'data': {'id': str(self.formdata.id)}})
raise AccessForbiddenError('formdata is not editable by given user')
@ -330,7 +330,7 @@ class ApiCardPage(ApiFormPageMixin, BackofficeCardPage):
{
'err': 0,
'data': {
'id': formdata.id,
'id': str(formdata.id),
'url': formdata.get_url(),
'backoffice_url': formdata.get_url(backoffice=True),
'api_url': formdata.get_api_url(),
@ -358,7 +358,7 @@ class ApiCardPage(ApiFormPageMixin, BackofficeCardPage):
'err': 0,
'data': {
'job': {
'id': job.id,
'id': str(job.id),
'url': get_publisher().get_frontoffice_url() + '/api/jobs/%s/' % job.id,
}
},
@ -605,7 +605,7 @@ class ApiFormdefDirectory(Directory):
{
'err': 0,
'data': {
'id': formdata.id,
'id': str(formdata.id),
'url': formdata.get_url(),
'backoffice_url': formdata.get_url(backoffice=True),
'api_url': formdata.get_api_url(),