Handle exception when blob has not signed_url
This commit is contained in:
@@ -367,7 +367,7 @@ def generate_link(backend, file_path, project_id=None):
|
|||||||
if backend == 'gcs':
|
if backend == 'gcs':
|
||||||
storage = GoogleCloudStorageBucket(project_id)
|
storage = GoogleCloudStorageBucket(project_id)
|
||||||
blob = storage.Get(file_path)
|
blob = storage.Get(file_path)
|
||||||
link = blob['signed_url']
|
link = None if not blob else blob['signed_url']
|
||||||
elif backend == 'pillar':
|
elif backend == 'pillar':
|
||||||
link = url_for('file_storage.index', file_name=file_path, _external=True,
|
link = url_for('file_storage.index', file_name=file_path, _external=True,
|
||||||
_scheme=app.config['SCHEME'])
|
_scheme=app.config['SCHEME'])
|
||||||
|
Reference in New Issue
Block a user