From 8d36b2ce099ca0475a3361afeab39b50a652eed4 Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Wed, 1 Nov 2023 14:13:09 -0400 Subject: [PATCH] change BE routing for preprints --- website/routes.py | 13 ++++++++++--- website/views.py | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/website/routes.py b/website/routes.py index 6634c6a97f5..787fe2e367b 100644 --- a/website/routes.py +++ b/website/routes.py @@ -260,9 +260,16 @@ def ember_app(path=None): for k in EXTERNAL_EMBER_APPS.keys(): if request.path.strip('/').startswith(k): ember_app = EXTERNAL_EMBER_APPS[k] - if k == 'preprints' and request.path.rstrip('/').endswith('discover'): - # Route preprint discover pages to new search page in EOW - ember_app = EXTERNAL_EMBER_APPS.get('ember_osf_web', False) or ember_app + if k == 'preprints': + if request.path.rstrip('/').endswith('edit'): + # Route preprint edit pages to old preprint app + ember_app = EXTERNAL_EMBER_APPS.get('preprints', False) or ember_app + elif request.path.rstrip('/').endswith('submit'): + # Route preprint submit pages to old preprint app + ember_app = EXTERNAL_EMBER_APPS.get('preprints', False) or ember_app + else: + # Route other preprint pages to EOW + ember_app = EXTERNAL_EMBER_APPS.get('ember_osf_web', False) or ember_app break if not ember_app: diff --git a/website/views.py b/website/views.py index c3051861791..ef1275551e8 100644 --- a/website/views.py +++ b/website/views.py @@ -332,7 +332,7 @@ def resolve_guid(guid, suffix=None): if isinstance(resource, Preprint): if resource.provider.domain_redirect_enabled: return redirect(resource.absolute_url, http_status.HTTP_301_MOVED_PERMANENTLY) - 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): return use_ember_app()