Commented out strip_link_and_variations(), to wait until we have is_public on files.
This commit is contained in:
parent
9362f9b539
commit
d3b3e0ff4f
@ -298,6 +298,11 @@ def generate_link(backend, file_path, project_id=None, is_public=False):
|
|||||||
def before_returning_file(response):
|
def before_returning_file(response):
|
||||||
ensure_valid_link(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.
|
# Check the access level of the user.
|
||||||
if g.current_user is None:
|
if g.current_user is None:
|
||||||
has_full_access = False
|
has_full_access = False
|
||||||
@ -313,7 +318,7 @@ def before_returning_file(response):
|
|||||||
|
|
||||||
# Image files have public variations, other files don't.
|
# Image files have public variations, other files don't.
|
||||||
if not response.get('content_type', '').startswith('image/'):
|
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'] = []
|
response['variations'] = []
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ class TempDirTest(AbstractPillarTest):
|
|||||||
|
|
||||||
|
|
||||||
class FileAccessTest(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."""
|
"""Subscribers should get all links, but non-subscribers only a subset."""
|
||||||
|
|
||||||
img_file_id, _ = self.ensure_file_exists()
|
img_file_id, _ = self.ensure_file_exists()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user