Link refresh: gracefully handle case where 'file_path' is not set.
In this case an error is logged and the entire link regeneration is aborted. In other words, variations aren't refreshed either.
This commit is contained in:
parent
4b5a961e14
commit
9177f77e69
@ -447,7 +447,14 @@ def generate_all_links(response, now):
|
|||||||
response['project']) if 'project' in response else None
|
response['project']) if 'project' in response else None
|
||||||
# TODO: add project id to all files
|
# TODO: add project id to all files
|
||||||
backend = response['backend']
|
backend = response['backend']
|
||||||
|
|
||||||
|
if 'file_path' in response:
|
||||||
response['link'] = generate_link(backend, response['file_path'], project_id)
|
response['link'] = generate_link(backend, response['file_path'], project_id)
|
||||||
|
else:
|
||||||
|
import pprint
|
||||||
|
log.error('File without file_path properly, unable to generate links: %s',
|
||||||
|
pprint.pformat(response))
|
||||||
|
return
|
||||||
|
|
||||||
variations = response.get('variations')
|
variations = response.get('variations')
|
||||||
if variations:
|
if variations:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user