mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-03-26 10:52:46 +00:00
Compare commits
1 Commits
dev
...
chore/fix-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e94d4ee38 |
@@ -1,6 +1,7 @@
|
|||||||
import datetime
|
import datetime
|
||||||
import hashlib
|
import hashlib
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
from enum import StrEnum
|
from enum import StrEnum
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@@ -833,7 +834,7 @@ class ConsumerPlugin(
|
|||||||
self.metadata.view_users is not None
|
self.metadata.view_users is not None
|
||||||
or self.metadata.view_groups is not None
|
or self.metadata.view_groups is not None
|
||||||
or self.metadata.change_users is not None
|
or self.metadata.change_users is not None
|
||||||
or self.metadata.change_users is not None
|
or self.metadata.change_groups is not None
|
||||||
):
|
):
|
||||||
permissions = {
|
permissions = {
|
||||||
"view": {
|
"view": {
|
||||||
@@ -866,7 +867,7 @@ class ConsumerPlugin(
|
|||||||
Path(source).open("rb") as read_file,
|
Path(source).open("rb") as read_file,
|
||||||
Path(target).open("wb") as write_file,
|
Path(target).open("wb") as write_file,
|
||||||
):
|
):
|
||||||
write_file.write(read_file.read())
|
shutil.copyfileobj(read_file, write_file)
|
||||||
|
|
||||||
# Attempt to copy file's original stats, but it's ok if we can't
|
# Attempt to copy file's original stats, but it's ok if we can't
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ from documents.models import Tag
|
|||||||
from documents.models import WorkflowRun
|
from documents.models import WorkflowRun
|
||||||
from documents.models import WorkflowTrigger
|
from documents.models import WorkflowTrigger
|
||||||
from documents.plugins.base import ConsumeTaskPlugin
|
from documents.plugins.base import ConsumeTaskPlugin
|
||||||
from documents.plugins.base import ProgressManager
|
|
||||||
from documents.plugins.base import StopConsumeTaskError
|
from documents.plugins.base import StopConsumeTaskError
|
||||||
|
from documents.plugins.helpers import ProgressManager
|
||||||
from documents.plugins.helpers import ProgressStatusOptions
|
from documents.plugins.helpers import ProgressStatusOptions
|
||||||
from documents.sanity_checker import SanityCheckFailedException
|
from documents.sanity_checker import SanityCheckFailedException
|
||||||
from documents.signals import document_updated
|
from documents.signals import document_updated
|
||||||
@@ -533,13 +533,13 @@ def check_scheduled_workflows() -> None:
|
|||||||
id__in=matched_ids,
|
id__in=matched_ids,
|
||||||
)
|
)
|
||||||
|
|
||||||
if documents.count() > 0:
|
if documents.exists():
|
||||||
documents = prefilter_documents_by_workflowtrigger(
|
documents = prefilter_documents_by_workflowtrigger(
|
||||||
documents,
|
documents,
|
||||||
trigger,
|
trigger,
|
||||||
)
|
)
|
||||||
|
|
||||||
if documents.count() > 0:
|
if documents.exists():
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"Found {documents.count()} documents for trigger {trigger}",
|
f"Found {documents.count()} documents for trigger {trigger}",
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user