[Global] Better explain 404 errors when "Not Found" is not the true cause.
Description
In our codebase there are numerous cases where an object is obtained via get_object_or_404
from querysets filtered on a number of criteria. This gives the false impression that an object does not exist, or something is wrong with the website, rather than that the object is not present because of some filtering criteria. Such criteria most often consist of permission checks and "deprecated" statuses of objects.
This issue serves as a place to fish these out and systematically ammend the error messages the users see.
List of messages
-
"Write a communication" on non-latest submissions. -
Declining an already declined refereee invitation. -
Publications before being public (https://scipost.org/SciPostPhys.XX.X.XXX).