Skip to content

Commit 2e6fffc

Browse files
author
Rose Reatherford
committed
Feature to allow the submission url to be overridden for custom pages.
Jira: RCT-429
1 parent 4bde358 commit 2e6fffc

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/core/janeway_global_settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,9 @@ def __len__(self):
567567
HIJACK_USERS_ENABLED = False
568568
HIJACK_LOGIN_REDIRECT_URL = "/manager/"
569569

570+
# Allows you to create your own submission page at `/start/submit` with the name `submission_start`.
571+
HIJACK_SUBMISSION_ENABLED = False
572+
570573

571574
# OIDC
572575
ENABLE_OIDC = bool(os.environ.get("ENABLE_OIDC", False))

src/submission/urls.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
__license__ = "AGPL v3"
44
__maintainer__ = "Birkbeck Centre for Technology and Publishing"
55
from django.urls import re_path
6+
from django.conf import settings
7+
from utils.logger import get_logger
68

79
from submission import views
810

11+
logger = get_logger(__name__)
12+
913
urlpatterns = [
10-
re_path(r"^start/$", views.start, name="submission_start"),
11-
re_path(r"^(?P<type>[-\w.]+)/start/$", views.start, name="submission_start"),
1214
re_path(r"^(?P<article_id>\d+)/info/$", views.submit_info, name="submit_info"),
1315
re_path(
1416
r"^(?P<article_id>\d+)/authors/$", views.submit_authors, name="submit_authors"
@@ -108,3 +110,12 @@
108110
name="submission_licenses_id",
109111
),
110112
]
113+
114+
if not settings.HIJACK_SUBMISSION_ENABLED:
115+
try:
116+
urlpatterns += [
117+
re_path(r"^start/$", views.start, name="submission_start"),
118+
re_path(r"^(?P<type>[-\w.]+)/start/$", views.start, name="submission_start"),
119+
]
120+
except AttributeError:
121+
logger.warning("Could not import default submission views.")

0 commit comments

Comments
 (0)