Added the possiblility for mass-deletion of posts via CLI #694
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
I created a script in the past that allows the user to mass delete posts after their ID. This script is more or less useful if you want to delete a large amount of posts and don't want to use the delete function on the post overview, which would require you to select each post manually.
The command can be executed with the admin command:
docker-compose run server ./szuru-admin --delete-posts
You can then either pass a range of ID's like
40-50
or individual ID's like35
. Passing values like50-40
is handled by simply switching them.I tested it on a test instance and also on my own live instance and it works.
However there is one problem. After running the script the posts are still shown on the page. Even after a hard reload they are still visible. If you click on them you get an error. The only fix for me was to either clear the cookies or to logout -> login again. For private instances that might be just fine, but if you use it with more people that can be annoying. If anyone has a suggestion on how to fix this, please tell me.