From d73e8b5b2d5394583be7ec66695c50897e3997d1 Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Wed, 7 Feb 2024 10:16:21 -0500 Subject: [PATCH] add None check for clean_suffix --- website/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/views.py b/website/views.py index c8939784c27..adee1d27887 100644 --- a/website/views.py +++ b/website/views.py @@ -339,7 +339,7 @@ def resolve_guid(guid, suffix=None): elif isinstance(resource, Registration) and (clean_suffix in ('', 'comments', 'links', 'components', 'resources',)) and waffle.flag_is_active(request, features.EMBER_REGISTRIES_DETAIL_PAGE): return use_ember_app() - elif isinstance(resource, Registration) and clean_suffix.startswith('metadata') and waffle.flag_is_active(request, features.EMBER_REGISTRIES_DETAIL_PAGE): + elif isinstance(resource, Registration) and clean_suffix and clean_suffix.startswith('metadata') and waffle.flag_is_active(request, features.EMBER_REGISTRIES_DETAIL_PAGE): return use_ember_app() elif isinstance(resource, Registration) and (clean_suffix in ('files', 'files/osfstorage')) and waffle.flag_is_active(request, features.EMBER_REGISTRATION_FILES): @@ -348,7 +348,7 @@ def resolve_guid(guid, suffix=None): elif isinstance(resource, Node) and clean_suffix and any(path.startswith(clean_suffix) for path in addon_paths) and waffle.flag_is_active(request, features.EMBER_PROJECT_FILES): return use_ember_app() - elif isinstance(resource, Node) and clean_suffix and clean_suffix.startswith('metadata') and waffle.flag_is_active(request, features.EMBER_PROJECT_FILES): + elif isinstance(resource, Node) and clean_suffix and clean_suffix.startswith('metadata'): return use_ember_app() elif isinstance(resource, BaseFileNode) and resource.is_file and not isinstance(resource.target, Preprint):