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:
Joseph Schorr 2017-10-05 15:20:16 -04:00
parent 3bef21253d
commit 2ce4e49711
6 changed files with 12 additions and 8 deletions

View file

@ -105,9 +105,9 @@ class DelegateUserfiles(object):
content_encoding)
return file_id
def get_file_url(self, file_id, expires_in=300, requires_cors=False):
def get_file_url(self, file_id, remote_ip, expires_in=300, requires_cors=False):
path = self.get_file_id_path(file_id)
url = self._storage.get_direct_download_url(self._locations, path, request.remote_addr, expires_in,
url = self._storage.get_direct_download_url(self._locations, path, remote_ip, expires_in,
requires_cors)
if url is None: