Skip to content

Conversation

@antkryt
Copy link
Contributor

@antkryt antkryt commented Sep 22, 2025

Purpose

add hard-delete draft preprint versions functionality to admin

Changes

  • add Hard Delete Draft button and modal to admin
  • add endpoint for draft preprint deletion
  • add unittests

QA Notes

Documentation

Side Effects

Ticket

https://openscience.atlassian.net/browse/ENG-8828

@antkryt antkryt changed the base branch from develop to feature/pbs-25-19 September 22, 2025 12:12
@adlius adlius deleted the branch CenterForOpenScience:feature/pbs-25-21 October 16, 2025 13:17
@adlius adlius closed this Oct 16, 2025
@adlius adlius reopened this Oct 22, 2025
@adlius adlius changed the base branch from feature/pbs-25-19 to feature/pbs-25-21 October 22, 2025 14:53
Copy link
Collaborator

@adlius adlius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question.

- The base Guid points to the latest published version
- We only delete the specific broken draft version, not the entire preprint lineage
"""
permission_required = ('osf.delete_preprint',)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is osf.delete_preprint only available to OSF Admins? If not, we might want something that's a bit more restrictive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, osf.delete_preprint is django-generated permission, I copied it from the PreprintDeleteView. As far as I know there's no django-generated permission to check if user is admin, so I'll add explicit check inside of the view

@antkryt
Copy link
Contributor Author

antkryt commented Oct 24, 2025

tests passed on my local branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants