diff --git a/app/api/helpers/storage.py b/app/api/helpers/storage.py index 3f0e9e02b5..0dc208170f 100644 --- a/app/api/helpers/storage.py +++ b/app/api/helpers/storage.py @@ -178,7 +178,7 @@ def upload_local(uploaded_file, key, upload_dir='static/media/', **kwargs): file_relative_path = '/' + file_relative_path if get_settings()['static_domain']: return get_settings()['static_domain'] + \ - file_relative_path.replace('/static', '') + file_relative_path return create_url(request.url, file_relative_path) diff --git a/tests/all/integration/api/helpers/test_storage.py b/tests/all/integration/api/helpers/test_storage.py index 29d594b5ae..b0a2f35cb5 100644 --- a/tests/all/integration/api/helpers/test_storage.py +++ b/tests/all/integration/api/helpers/test_storage.py @@ -19,7 +19,7 @@ def Setup(self): @patch('app.api.helpers.storage.get_settings', return_value={'static_domain': 'https://next.eventyay.com'}) @patch('app.api.helpers.storage.UploadedFile') def test_upload_local(self, uploadedfile_object, settings, generated_hash, uploadlocal): - expected_response = 'https://next.eventyay.com/media/upload_key/hash/test.pdf' + expected_response = 'https://next.eventyay.com/static/media/upload_key/hash/test.pdf' uploadedfile_object.filename = 'test.pdf' with app.test_request_context():