-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redirect to ManuscriptListView when manuscript is not found #803
Redirect to ManuscriptListView when manuscript is not found #803
Conversation
Why not do both? Return a 404 (signalling to browsers, caches, search engines, etc. that it's no longer there) but with a custom 404 page pointing to the MSS list, and letting the users know that they should update their bookmarks. |
Ok, this makes sense! thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I suggested a couple of small tweaks which you can implement if you'd like. The one in the docstring is extremely optional.
to return a custom 404 page if the manuscript | ||
is not found. Implemented to prevent generic | ||
404 errors from links to specific manuscripts | ||
made before manuscript ids were stable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would suggest IDs
rather than ids
.
<div class="row" style="padding-top:20vh;padding-bottom:20vh"> | ||
<div class="col-lg-12"> | ||
<p class="text-center">This manuscript has been moved.</p> | ||
<p class="text-center">You can find it on <a href="{% url 'manuscript-list' %}">the Manuscripts page</a>.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should the link be applied to "Manuscripts page", or even just "Manuscripts"? Including the article feels weird to me.
Both the title and the path of the page in question use just "manuscripts". Suggesting you move the "the" and the "page" out of the link.
Overrides the default
retrieve
method of the ManuscriptDetailView class so that when a manuscript with the requested ID is not found, a custom404
page is returned that directs users to the ManuscriptListView (see below).As mentioned in the function's comment, this is meant to mitigate cases where a link to a specific manuscript was published before manuscripts in Cantus Ultimus had stable ID's.
Closes #802
Custom 404 Page
https://user-images.githubusercontent.com/11023634/284639619-89ed0747-a41a-46ae-82f8-a69cdda4b741.png