From d3b3e0ff4f6f038c4edeb25552b214047c5a3581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 10 May 2016 13:38:07 +0200 Subject: [PATCH] Commented out strip_link_and_variations(), to wait until we have is_public on files. --- pillar/application/modules/file_storage.py | 7 ++++++- tests/test_file_storage.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pillar/application/modules/file_storage.py b/pillar/application/modules/file_storage.py index ffa23e75..eea5fd73 100644 --- a/pillar/application/modules/file_storage.py +++ b/pillar/application/modules/file_storage.py @@ -298,6 +298,11 @@ def generate_link(backend, file_path, project_id=None, is_public=False): def before_returning_file(response): ensure_valid_link(response) + # Enable this call later, when we have implemented the is_public field on files. + # strip_link_and_variations(response) + + +def strip_link_and_variations(response): # Check the access level of the user. if g.current_user is None: has_full_access = False @@ -313,7 +318,7 @@ def before_returning_file(response): # Image files have public variations, other files don't. if not response.get('content_type', '').startswith('image/'): - if 'variations' in response and response['variations'] is not None: + if response.get('variations') is not None: response['variations'] = [] diff --git a/tests/test_file_storage.py b/tests/test_file_storage.py index 379efb8d..de466673 100644 --- a/tests/test_file_storage.py +++ b/tests/test_file_storage.py @@ -69,7 +69,7 @@ class TempDirTest(AbstractPillarTest): class FileAccessTest(AbstractPillarTest): - def test_link_stripping(self): + def __test_link_stripping(self): """Subscribers should get all links, but non-subscribers only a subset.""" img_file_id, _ = self.ensure_file_exists()