janeway icon indicating copy to clipboard operation
janeway copied to clipboard

Prepub checklist broken in path mode

Open joemull opened this issue 6 months ago • 0 comments

Problem

The function that processes tick marks on the prepublication checklist needs journal to be in the request, to pass security checks:

https://github.com/openlibhums/janeway/blob/14ec665e08fd2428e587259984b77c5e67830cca/src/journal/views.py#L1266-L1281

But the JavaScript that creates the URL only considers domain mode journals and hard-codes the POST url:

https://github.com/openlibhums/janeway/blob/14ec665e08fd2428e587259984b77c5e67830cca/src/templates/admin/journal/publish_article.html#L276

As a result, the middleware does not know what the journal is, and adds no journal onto the request object. So when the user clicks a tick mark, nothing happens, and permission denied is logged unseen on the server.

Proposed solution

Use Django url to form the URL in the JS so it works for both path and domain mode.

joemull avatar Aug 30 '24 10:08 joemull