maarch: use debug_ouput and logger.debug only in debug context (#78310)
gitea/passerelle-minint/pipeline/head This commit looks good Details

This commit is contained in:
Thomas NOËL 2023-06-12 14:54:50 +02:00
parent cac4fc709e
commit 5d2943252e
1 changed files with 5 additions and 3 deletions

View File

@ -463,7 +463,8 @@ class AttachmentView(DetailView):
logger.debug('storeAttachment: start')
debug_output['res'] = []
if debug:
debug_output['res'] = []
# store attachments
nbAttachments = len(attachments)
@ -501,11 +502,12 @@ class AttachmentView(DetailView):
resId, collId, attachment['content'], attachment['fileFormat'], attachment['filename']
)
res = sudsobject_to_dict(results)
debug_output['res'].append(res)
if debug:
debug_output['res'].append(res)
if debug:
data['debug'] = debug_output
logger.debug('debug : %r', data['debug'])
logger.debug('debug : %r', data['debug'])
logger.debug('storeAttachment: resId:%r -- end', resId)
return utils.response_for_json(request, data)