mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 03:06:31 -05:00
fixup! Add fix for missing deletion of notes on user-deletion request
This commit is contained in:
parent
1ed522bd85
commit
4884292b68
1 changed files with 17 additions and 0 deletions
17
bin/cleanup
17
bin/cleanup
|
@ -50,6 +50,23 @@ async function cleanup() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
await models.Revision.findAll({
|
||||||
|
include: [{
|
||||||
|
model: models.Note,
|
||||||
|
as: 'note'
|
||||||
|
}]
|
||||||
|
}).then(async function(revisions) {
|
||||||
|
for(let i =0, revisionCount = revisions.length; i< revisionCount; i++) {
|
||||||
|
const item = revisions[i]
|
||||||
|
if(item.noteId != null && !item.note) {
|
||||||
|
await models.Revision.destroy({
|
||||||
|
where: {
|
||||||
|
id: item.id
|
||||||
|
}})
|
||||||
|
logger.info(`Deleted revision ${item.id} from note ${item.userId}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue