Skip to content

Commit

Permalink
fix double deletion of draftnodes
Browse files Browse the repository at this point in the history
  • Loading branch information
John Tordoff committed Oct 9, 2023
1 parent 7501822 commit 661fb37
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions osf/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -1987,14 +1987,10 @@ def gdpr_delete(self):
# This is doesn't to remove identifying info, but ensures other users can't see the deleted user's profile etc.
self.deactivate_account()

# delete all personal nodes (one contributor), bookmarks, quickfiles etc.
# delete all personal nodes (one contributor), bookmarks, draftnodes etc.
for node in personal_nodes.all():
if isinstance(node, DraftNode):
logger.info(f'Hard-deleting draftnode (pk: {node.pk})...')
node.delete()
else:
logger.info(f'Soft-deleting node (pk: {node.pk})...')
node.remove_node(auth=Auth(self))
logger.info(f'Soft-deleting node (pk: {node.pk})...')
node.remove_node(auth=Auth(self))

for draft_registration in personal_draft_registrations.all():
logger.info(f'Hard-deleting draft registrations (pk: {draft_registration.pk})...')
Expand Down

0 comments on commit 661fb37

Please sign in to comment.