diff --git a/pillar/application/modules/blender_cloud/texture_libs.py b/pillar/application/modules/blender_cloud/texture_libs.py index c84a22c5..aa873ece 100644 --- a/pillar/application/modules/blender_cloud/texture_libs.py +++ b/pillar/application/modules/blender_cloud/texture_libs.py @@ -8,6 +8,7 @@ from werkzeug.datastructures import MultiDict from werkzeug.exceptions import InternalServerError from application import utils +from application.utils.authentication import current_user_id from application.utils.authorization import require_login FIRST_ADDON_VERSION_WITH_HDRI = (1, 4, 0) @@ -73,7 +74,11 @@ def texture_libraries(): # Determine whether to return HDRi projects too, based on the version # of the Blender Cloud Addon. If the addon version is None, we're dealing # with a version of the BCA that's so old it doesn't send its version along. - return_hdri = blender_cloud_addon_version() > FIRST_ADDON_VERSION_WITH_HDRI + addon_version = blender_cloud_addon_version() + return_hdri = addon_version >= FIRST_ADDON_VERSION_WITH_HDRI + log.debug('User %s has Blender Cloud Addon version %s; return_hdri=%s', + current_user_id(), addon_version, return_hdri) + accept_as_library = functools.partial(has_texture_node, return_hdri=return_hdri) # Construct eve-like response. diff --git a/tests/test_bcloud_home_project.py b/tests/test_bcloud_home_project.py index 3e6e2c59..1b282739 100644 --- a/tests/test_bcloud_home_project.py +++ b/tests/test_bcloud_home_project.py @@ -506,5 +506,5 @@ class TextureLibraryTest(AbstractHomeProjectTest): headers={'Blender-Cloud-Addon': '1.4.0'}) libs = resp.json()['_items'] library_project_ids = {proj['_id'] for proj in libs} - self.assertNotIn(unicode(self.hdri_proj_id), library_project_ids) + self.assertIn(unicode(self.hdri_proj_id), library_project_ids) self.assertIn(unicode(self.tex_proj_id), library_project_ids)