cmu-lib / archive_plugin

Janeway plugin for managing journal archiving.
MIT License
8 stars 2 forks source link

Create archive button #18

Closed mdlincoln closed 5 years ago

mdlincoln commented 5 years ago

This adds a button to the archive plugin settings page that allows an editor to call the create_archive management command. On successfully running the command, this will redirect the editor to the issue management page where they can see the issue and edit its name/metadata if they wish.

Closes https://github.com/dSHARP-CMU/cmesh-dev/issues/316

mdlincoln commented 5 years ago

@hachacha newb question: does this link need to be modified somehow so that it's treated as a POST/checks for a CSRF token? There's no data to submit, but by calling the create_archive view it does change the DB

hachacha commented 5 years ago

Yes I think so. Now there's now a public facing URL in urls.py that could be hit by anyone it should probably have a csrf token. It might be excessive (since we also have the security decorator there) but if we can do it with no other issues, why not? Going to put that change in here and also add a redirect on the exception so you don't go to the issues page if there's an error.