[GH-ISSUE #167] Digest validation #130

Closed
opened 2026-02-25 21:31:16 +03:00 by kerem · 2 comments
Owner

Originally created by @francescocarzaniga on GitHub (Oct 14, 2020).
Original GitHub issue: https://github.com/ciur/papermerge/issues/167

Originally assigned to: @ciur on GitHub.

I think that having a digest+user validation to prevent duplicate file upload is a good thing. When I have thousands or more documents I would like to avoid importing duplicates.

I understand this makes testing more difficult, but disabling validation in production because they are an inconvenience does not sound too good. There could at least be a setting for it, possibly per-user.

Originally created by @francescocarzaniga on GitHub (Oct 14, 2020). Original GitHub issue: https://github.com/ciur/papermerge/issues/167 Originally assigned to: @ciur on GitHub. I think that having a digest+user validation to prevent duplicate file upload is a good thing. When I have thousands or more documents I would like to avoid importing duplicates. I understand this makes testing more difficult, but disabling validation in production because they are an inconvenience does not sound too good. There could at least be a setting for it, possibly per-user.
kerem 2026-02-25 21:31:16 +03:00
Author
Owner

@ciur commented on GitHub (Oct 15, 2020):

@francescocarzaniga, my plans is to make papermerge easy to extend. Your ticket sounds to me like a perfect candidate for plugin/app/add-on for Papermerge.
I am investigating different ways "how to make papermerge extensible". When I will find a reasonable approach, I will document and you would be able to add an extension with "digest validation".
Without a good plugin/app system, we can infinitely debate the pros and cons of digest validation.

<!-- gh-comment-id:709433122 --> @ciur commented on GitHub (Oct 15, 2020): @francescocarzaniga, my plans is to make papermerge easy to extend. Your ticket sounds to me like a perfect candidate for plugin/app/add-on for Papermerge. I am investigating different ways "how to make papermerge extensible". When I will find a reasonable approach, I will document and you would be able to add an extension with "digest validation". Without a good plugin/app system, we can infinitely debate the pros and cons of digest validation.
Author
Owner

@ciur commented on GitHub (Oct 20, 2020):

@francescocarzaniga, the master branch now contains papermerge.core.models.AbstractDocument model - you can use it to write your own (django based apps) plugins to add whatever additional validations you wish.

See pagelimit app as example how to add additional document validations in external apps.
This is still experimental API, but it is already usable. limitpages app is used in demo to limit number of pages for uploaded docs.

You want to use get_absfilepath function to get access to the document's file.

<!-- gh-comment-id:712609047 --> @ciur commented on GitHub (Oct 20, 2020): @francescocarzaniga, the master branch now contains papermerge.core.models.AbstractDocument model - you can use it to write your own (django based apps) plugins to add whatever additional validations you wish. See [pagelimit app](https://github.com/papermerge/limitpages) as example how to add additional document validations in external apps. This is still experimental API, but it is already usable. [limitpages app](https://github.com/papermerge/limitpages) is used in [demo](https://www.papermerge.com/demo) to limit number of pages for uploaded docs. You want to use [get_absfilepath](https://github.com/ciur/papermerge/blob/master/papermerge/core/models/document.py#L694) function to get access to the document's file.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/papermerge#130
No description provided.