paperless-ng icon indicating copy to clipboard operation
paperless-ng copied to clipboard

Add simple "delete to trash" functionality

Open tribut opened this issue 3 years ago • 1 comments

Edit: Moved to https://github.com/paperless-ngx/paperless-ngx/pull/24

Adds PAPERLESS_THRASH_DIR. When set, original files are moved there instead of being unlinked when a document is deleted.

Implements the first point from https://github.com/jonaswinkler/paperless-ng/discussions/693.

The idea is that this prevents accidental (or malicious) permanent deletion of a document. This is the most minimalist implementation I could think of, there are no changes to the GUI at all – just a directory that keeps the originals that would otherwise have been removed.

Edit: Failing CI seems bogus (frontend ran into npm timeout and coveralls says coverage decreased by 0.003% - rounding error?)

tribut avatar Aug 22 '21 21:08 tribut

This pretty much LGTM. I'm not super familiar with the testing, but I'm not seeing any problems. @tribut would you mind putting the os.rename call in handlers.py:248 in a try except to handle any exceptions caused by permission errors, etc? And also, there is an extra new line in test_file_handling.py on line 191.

edit: oops commented on the wrong PR

dblitt avatar Feb 16 '22 16:02 dblitt