From 7336b7148592fefe0dae34200f754ecf4ff757d9 Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Tue, 6 Feb 2024 11:26:34 -0500 Subject: [PATCH] add some more rules --- website/views.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/website/views.py b/website/views.py index a8f704210699..3c0baa475053 100644 --- a/website/views.py +++ b/website/views.py @@ -336,7 +336,10 @@ def resolve_guid(guid, suffix=None): return stream_emberapp(EXTERNAL_EMBER_APPS['preprints']['server'], preprints_dir) return use_ember_app() - elif isinstance(resource, Registration) and (clean_suffix in ('', 'comments', 'links', 'components', 'resources',)) and waffle.flag_is_active(request, features.EMBER_REGISTRIES_DETAIL_PAGE): + 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): 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): @@ -345,6 +348,9 @@ 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): + return use_ember_app() + elif isinstance(resource, BaseFileNode) and resource.is_file and not isinstance(resource.target, Preprint): if isinstance(resource.target, Registration) and waffle.flag_is_active(request, features.EMBER_FILE_REGISTRATION_DETAIL): return use_ember_app()