@@ -327,27 +327,12 @@ def get_jobs(api: API, request: APIRequest,
327327 job_result_url = f"{ api .base_url } /jobs/{ job_ ['identifier' ]} /results" # noqa
328328
329329 job2 ['links' ] = [{
330- 'href' : f' { job_result_url } ?f= { F_HTML } ' ,
330+ 'href' : job_result_url ,
331331 'rel' : 'http://www.opengis.net/def/rel/ogc/1.0/results' ,
332- 'type' : FORMAT_TYPES [F_HTML ],
333- 'title' : l10n .translate (f'Results of job as HTML' , request .locale ), # noqa
334- }, {
335- 'href' : f'{ job_result_url } ?f={ F_JSON } ' ,
336- 'rel' : 'http://www.opengis.net/def/rel/ogc/1.0/results' ,
337- 'type' : FORMAT_TYPES [F_JSON ],
338- 'title' : l10n .translate (f'Results of job as JSON' , request .locale ), # noqa
332+ 'type' : job_ ['mimetype' ],
333+ 'title' : f"Results of job { job_id } as { job_ ['mimetype' ]} "
339334 }]
340335
341- if job_ ['mimetype' ] not in (FORMAT_TYPES [F_JSON ],
342- FORMAT_TYPES [F_HTML ]):
343-
344- job2 ['links' ].append ({
345- 'href' : job_result_url ,
346- 'rel' : 'http://www.opengis.net/def/rel/ogc/1.0/results' , # noqa
347- 'type' : job_ ['mimetype' ],
348- 'title' : f"Results of job { job_id } as { job_ ['mimetype' ]} " # noqa
349- })
350-
351336 serialized_jobs ['jobs' ].append (job2 )
352337
353338 serialized_query_params = ''
@@ -528,7 +513,10 @@ def execute_process(api: API, request: APIRequest,
528513 pretty_print_ = False
529514 response2 = to_json (response , pretty_print_ )
530515 else :
516+ pretty_print_ = False
531517 response2 = response
518+ if isinstance (response , (list , dict )):
519+ response2 = to_json (response , pretty_print_ )
532520
533521 if (headers .get ('Preference-Applied' , '' ) == RequestedProcessExecutionMode .respond_async .value ): # noqa
534522 LOGGER .debug ('Asynchronous mode detected, returning statusInfo' )
0 commit comments