Build job does not have a request context when calling get_file_url
We therefore need to specify some sort of IP or get_file_url will attempt to get it from context
This commit is contained in:
parent
3bef21253d
commit
2ce4e49711
6 changed files with 12 additions and 8 deletions
|
@ -151,7 +151,8 @@ def build_status_view(build_obj):
|
|||
|
||||
if can_write or features.READER_BUILD_LOGS:
|
||||
if build_obj.resource_key is not None:
|
||||
resp['archive_url'] = user_files.get_file_url(build_obj.resource_key, requires_cors=True)
|
||||
resp['archive_url'] = user_files.get_file_url(build_obj.resource_key,
|
||||
request.remote_addr, requires_cors=True)
|
||||
elif job_config.get('archive_url', None):
|
||||
resp['archive_url'] = job_config['archive_url']
|
||||
|
||||
|
@ -402,7 +403,7 @@ def get_logs_or_log_url(build):
|
|||
# If the logs have been archived, just return a URL of the completed archive
|
||||
if build.logs_archived:
|
||||
return {
|
||||
'logs_url': log_archive.get_file_url(build.uuid, requires_cors=True)
|
||||
'logs_url': log_archive.get_file_url(build.uuid, request.remote_addr, requires_cors=True)
|
||||
}
|
||||
start = int(request.args.get('start', 0))
|
||||
|
||||
|
|
Reference in a new issue