mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Fixes ruff not running isort against the codebase
This commit is contained in:
parent
e0d2697618
commit
3bcbd05252
@ -1,6 +1,6 @@
|
|||||||
# https://beta.ruff.rs/docs/settings/
|
# https://beta.ruff.rs/docs/settings/
|
||||||
# https://beta.ruff.rs/docs/rules/
|
# https://beta.ruff.rs/docs/rules/
|
||||||
select = ["F", "E", "W", "UP", "COM", "DJ", "EXE", "ISC", "ICN", "G201", "INP", "PIE", "RSE", "SIM", "TID", "PLC", "PLE", "RUF"]
|
extend-select = ["I", "W", "UP", "COM", "DJ", "EXE", "ISC", "ICN", "G201", "INP", "PIE", "RSE", "SIM", "TID", "PLC", "PLE", "RUF"]
|
||||||
# TODO PTH
|
# TODO PTH
|
||||||
ignore = ["DJ001", "SIM105"]
|
ignore = ["DJ001", "SIM105"]
|
||||||
fix = true
|
fix = true
|
||||||
|
@ -10,15 +10,13 @@ class DocumentsConfig(AppConfig):
|
|||||||
|
|
||||||
def ready(self):
|
def ready(self):
|
||||||
from .signals import document_consumption_finished
|
from .signals import document_consumption_finished
|
||||||
from .signals.handlers import (
|
from .signals.handlers import add_inbox_tags
|
||||||
add_inbox_tags,
|
from .signals.handlers import add_to_index
|
||||||
set_log_entry,
|
from .signals.handlers import set_correspondent
|
||||||
set_correspondent,
|
from .signals.handlers import set_document_type
|
||||||
set_document_type,
|
from .signals.handlers import set_log_entry
|
||||||
set_tags,
|
from .signals.handlers import set_storage_path
|
||||||
set_storage_path,
|
from .signals.handlers import set_tags
|
||||||
add_to_index,
|
|
||||||
)
|
|
||||||
|
|
||||||
document_consumption_finished.connect(add_inbox_tags)
|
document_consumption_finished.connect(add_inbox_tags)
|
||||||
document_consumption_finished.connect(set_correspondent)
|
document_consumption_finished.connect(set_correspondent)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import itertools
|
import itertools
|
||||||
|
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
|
|
||||||
from documents.models import Correspondent
|
from documents.models import Correspondent
|
||||||
from documents.models import Document
|
from documents.models import Document
|
||||||
from documents.models import DocumentType
|
from documents.models import DocumentType
|
||||||
|
@ -6,6 +6,7 @@ from django.core.checks import register
|
|||||||
from django.core.exceptions import FieldError
|
from django.core.exceptions import FieldError
|
||||||
from django.db.utils import OperationalError
|
from django.db.utils import OperationalError
|
||||||
from django.db.utils import ProgrammingError
|
from django.db.utils import ProgrammingError
|
||||||
|
|
||||||
from documents.signals import document_consumer_declaration
|
from documents.signals import document_consumer_declaration
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ from typing import List
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
from documents.models import Document
|
from documents.models import Document
|
||||||
from documents.models import MatchingModel
|
from documents.models import MatchingModel
|
||||||
|
|
||||||
@ -336,10 +337,9 @@ class DocumentClassifier:
|
|||||||
if settings.NLTK_LANGUAGE is not None and settings.NLTK_ENABLED:
|
if settings.NLTK_LANGUAGE is not None and settings.NLTK_ENABLED:
|
||||||
|
|
||||||
import nltk
|
import nltk
|
||||||
|
|
||||||
from nltk.tokenize import word_tokenize
|
|
||||||
from nltk.corpus import stopwords
|
from nltk.corpus import stopwords
|
||||||
from nltk.stem import SnowballStemmer
|
from nltk.stem import SnowballStemmer
|
||||||
|
from nltk.tokenize import word_tokenize
|
||||||
|
|
||||||
# Not really hacky, since it isn't private and is documented, but
|
# Not really hacky, since it isn't private and is documented, but
|
||||||
# set the search path for NLTK data to the single location it should be in
|
# set the search path for NLTK data to the single location it should be in
|
||||||
|
@ -31,9 +31,9 @@ from .models import DocumentType
|
|||||||
from .models import FileInfo
|
from .models import FileInfo
|
||||||
from .models import Tag
|
from .models import Tag
|
||||||
from .parsers import DocumentParser
|
from .parsers import DocumentParser
|
||||||
|
from .parsers import ParseError
|
||||||
from .parsers import get_parser_class_for_mime_type
|
from .parsers import get_parser_class_for_mime_type
|
||||||
from .parsers import parse_date
|
from .parsers import parse_date
|
||||||
from .parsers import ParseError
|
|
||||||
from .signals import document_consumption_finished
|
from .signals import document_consumption_finished
|
||||||
from .signals import document_consumption_started
|
from .signals import document_consumption_started
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import pathvalidate
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.template.defaultfilters import slugify
|
from django.template.defaultfilters import slugify
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
from documents.models import Document
|
from documents.models import Document
|
||||||
|
|
||||||
logger = logging.getLogger("paperless.filehandling")
|
logger = logging.getLogger("paperless.filehandling")
|
||||||
|
@ -11,7 +11,6 @@ from .models import Log
|
|||||||
from .models import StoragePath
|
from .models import StoragePath
|
||||||
from .models import Tag
|
from .models import Tag
|
||||||
|
|
||||||
|
|
||||||
CHAR_KWARGS = ["istartswith", "iendswith", "icontains", "iexact"]
|
CHAR_KWARGS = ["istartswith", "iendswith", "icontains", "iexact"]
|
||||||
ID_KWARGS = ["in", "exact"]
|
ID_KWARGS = ["in", "exact"]
|
||||||
INT_KWARGS = ["exact", "gt", "gte", "lt", "lte", "isnull"]
|
INT_KWARGS = ["exact", "gt", "gte", "lt", "lte", "isnull"]
|
||||||
|
@ -6,8 +6,6 @@ from contextlib import contextmanager
|
|||||||
from dateutil.parser import isoparse
|
from dateutil.parser import isoparse
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from documents.models import Document
|
|
||||||
from documents.models import Note
|
|
||||||
from guardian.shortcuts import get_users_with_perms
|
from guardian.shortcuts import get_users_with_perms
|
||||||
from whoosh import classify
|
from whoosh import classify
|
||||||
from whoosh import highlight
|
from whoosh import highlight
|
||||||
@ -16,8 +14,8 @@ from whoosh.fields import BOOLEAN
|
|||||||
from whoosh.fields import DATETIME
|
from whoosh.fields import DATETIME
|
||||||
from whoosh.fields import KEYWORD
|
from whoosh.fields import KEYWORD
|
||||||
from whoosh.fields import NUMERIC
|
from whoosh.fields import NUMERIC
|
||||||
from whoosh.fields import Schema
|
|
||||||
from whoosh.fields import TEXT
|
from whoosh.fields import TEXT
|
||||||
|
from whoosh.fields import Schema
|
||||||
from whoosh.highlight import HtmlFormatter
|
from whoosh.highlight import HtmlFormatter
|
||||||
from whoosh.index import create_in
|
from whoosh.index import create_in
|
||||||
from whoosh.index import exists_in
|
from whoosh.index import exists_in
|
||||||
@ -28,6 +26,9 @@ from whoosh.searching import ResultsPage
|
|||||||
from whoosh.searching import Searcher
|
from whoosh.searching import Searcher
|
||||||
from whoosh.writing import AsyncWriter
|
from whoosh.writing import AsyncWriter
|
||||||
|
|
||||||
|
from documents.models import Document
|
||||||
|
from documents.models import Note
|
||||||
|
|
||||||
logger = logging.getLogger("paperless.index")
|
logger = logging.getLogger("paperless.index")
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ import os
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
from django.core.management.base import CommandError
|
from django.core.management.base import CommandError
|
||||||
|
|
||||||
from documents.models import Document
|
from documents.models import Document
|
||||||
from paperless.db import GnuPG
|
from paperless.db import GnuPG
|
||||||
|
|
||||||
|
@ -6,10 +6,10 @@ import tqdm
|
|||||||
from django import db
|
from django import db
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
|
|
||||||
from documents.models import Document
|
from documents.models import Document
|
||||||
from documents.tasks import update_document_archive_file
|
from documents.tasks import update_document_archive_file
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger("paperless.management.archiver")
|
logger = logging.getLogger("paperless.management.archiver")
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,17 +13,19 @@ from typing import Set
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
from django.core.management.base import CommandError
|
from django.core.management.base import CommandError
|
||||||
|
from watchdog.events import FileSystemEventHandler
|
||||||
|
from watchdog.observers.polling import PollingObserver
|
||||||
|
|
||||||
from documents.data_models import ConsumableDocument
|
from documents.data_models import ConsumableDocument
|
||||||
from documents.data_models import DocumentMetadataOverrides
|
from documents.data_models import DocumentMetadataOverrides
|
||||||
from documents.data_models import DocumentSource
|
from documents.data_models import DocumentSource
|
||||||
from documents.models import Tag
|
from documents.models import Tag
|
||||||
from documents.parsers import is_file_ext_supported
|
from documents.parsers import is_file_ext_supported
|
||||||
from documents.tasks import consume_file
|
from documents.tasks import consume_file
|
||||||
from watchdog.events import FileSystemEventHandler
|
|
||||||
from watchdog.observers.polling import PollingObserver
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from inotifyrecursive import INotify, flags
|
from inotifyrecursive import INotify
|
||||||
|
from inotifyrecursive import flags
|
||||||
except ImportError: # pragma: nocover
|
except ImportError: # pragma: nocover
|
||||||
INotify = flags = None
|
INotify = flags = None
|
||||||
|
|
||||||
|
@ -17,6 +17,10 @@ from django.core.management.base import BaseCommand
|
|||||||
from django.core.management.base import CommandError
|
from django.core.management.base import CommandError
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
from filelock import FileLock
|
||||||
|
|
||||||
|
from documents.file_handling import delete_empty_directories
|
||||||
|
from documents.file_handling import generate_filename
|
||||||
from documents.models import Correspondent
|
from documents.models import Correspondent
|
||||||
from documents.models import Document
|
from documents.models import Document
|
||||||
from documents.models import DocumentType
|
from documents.models import DocumentType
|
||||||
@ -29,15 +33,11 @@ from documents.models import UiSettings
|
|||||||
from documents.settings import EXPORTER_ARCHIVE_NAME
|
from documents.settings import EXPORTER_ARCHIVE_NAME
|
||||||
from documents.settings import EXPORTER_FILE_NAME
|
from documents.settings import EXPORTER_FILE_NAME
|
||||||
from documents.settings import EXPORTER_THUMBNAIL_NAME
|
from documents.settings import EXPORTER_THUMBNAIL_NAME
|
||||||
from filelock import FileLock
|
|
||||||
from paperless import version
|
from paperless import version
|
||||||
from paperless.db import GnuPG
|
from paperless.db import GnuPG
|
||||||
from paperless_mail.models import MailAccount
|
from paperless_mail.models import MailAccount
|
||||||
from paperless_mail.models import MailRule
|
from paperless_mail.models import MailRule
|
||||||
|
|
||||||
from documents.file_handling import delete_empty_directories
|
|
||||||
from documents.file_handling import generate_filename
|
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
|
|
||||||
|
@ -14,16 +14,16 @@ from django.core.management.base import CommandError
|
|||||||
from django.core.serializers.base import DeserializationError
|
from django.core.serializers.base import DeserializationError
|
||||||
from django.db.models.signals import m2m_changed
|
from django.db.models.signals import m2m_changed
|
||||||
from django.db.models.signals import post_save
|
from django.db.models.signals import post_save
|
||||||
|
from filelock import FileLock
|
||||||
|
|
||||||
|
from documents.file_handling import create_source_path_directory
|
||||||
from documents.models import Document
|
from documents.models import Document
|
||||||
from documents.parsers import run_convert
|
from documents.parsers import run_convert
|
||||||
from documents.settings import EXPORTER_ARCHIVE_NAME
|
from documents.settings import EXPORTER_ARCHIVE_NAME
|
||||||
from documents.settings import EXPORTER_FILE_NAME
|
from documents.settings import EXPORTER_FILE_NAME
|
||||||
from documents.settings import EXPORTER_THUMBNAIL_NAME
|
from documents.settings import EXPORTER_THUMBNAIL_NAME
|
||||||
from filelock import FileLock
|
|
||||||
from paperless import version
|
|
||||||
|
|
||||||
from documents.file_handling import create_source_path_directory
|
|
||||||
from documents.signals.handlers import update_filename_and_move_files
|
from documents.signals.handlers import update_filename_and_move_files
|
||||||
|
from paperless import version
|
||||||
|
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
from django.core.management import BaseCommand
|
from django.core.management import BaseCommand
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
|
|
||||||
from documents.tasks import index_optimize
|
from documents.tasks import index_optimize
|
||||||
from documents.tasks import index_reindex
|
from documents.tasks import index_reindex
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ import logging
|
|||||||
import tqdm
|
import tqdm
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
from django.db.models.signals import post_save
|
from django.db.models.signals import post_save
|
||||||
|
|
||||||
from documents.models import Document
|
from documents.models import Document
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,15 +2,14 @@ import logging
|
|||||||
|
|
||||||
import tqdm
|
import tqdm
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
|
|
||||||
from documents.classifier import load_classifier
|
from documents.classifier import load_classifier
|
||||||
from documents.models import Document
|
from documents.models import Document
|
||||||
|
|
||||||
from documents.signals.handlers import set_correspondent
|
from documents.signals.handlers import set_correspondent
|
||||||
from documents.signals.handlers import set_document_type
|
from documents.signals.handlers import set_document_type
|
||||||
from documents.signals.handlers import set_storage_path
|
from documents.signals.handlers import set_storage_path
|
||||||
from documents.signals.handlers import set_tags
|
from documents.signals.handlers import set_tags
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger("paperless.management.retagger")
|
logger = logging.getLogger("paperless.management.retagger")
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
|
|
||||||
from documents.sanity_checker import check_sanity
|
from documents.sanity_checker import check_sanity
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@ import shutil
|
|||||||
import tqdm
|
import tqdm
|
||||||
from django import db
|
from django import db
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
from documents.models import Document
|
|
||||||
|
|
||||||
|
from documents.models import Document
|
||||||
from documents.parsers import get_parser_class_for_mime_type
|
from documents.parsers import get_parser_class_for_mime_type
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ import os
|
|||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger("paperless.management.superuser")
|
logger = logging.getLogger("paperless.management.superuser")
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ from documents.models import StoragePath
|
|||||||
from documents.models import Tag
|
from documents.models import Tag
|
||||||
from documents.permissions import get_objects_for_user_owner_aware
|
from documents.permissions import get_objects_for_user_owner_aware
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger("paperless.matching")
|
logger = logging.getLogger("paperless.matching")
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
# Generated by Django 1.9 on 2015-12-20 19:10
|
# Generated by Django 1.9 on 2015-12-20 19:10
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
# Generated by Django 1.9 on 2015-12-26 13:16
|
# Generated by Django 1.9 on 2015-12-26 13:16
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.utils.timezone
|
import django.utils.timezone
|
||||||
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
# Generated by Django 1.9 on 2016-01-11 12:21
|
# Generated by Django 1.9 on 2016-01-11 12:21
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
from django.template.defaultfilters import slugify
|
|
||||||
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
from django.template.defaultfilters import slugify
|
||||||
|
|
||||||
DOCUMENT_SENDER_MAP = {}
|
DOCUMENT_SENDER_MAP = {}
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
# Generated by Django 1.9 on 2016-01-14 18:44
|
# Generated by Django 1.9 on 2016-01-14 18:44
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 1.9 on 2016-01-23 04:30
|
# Generated by Django 1.9 on 2016-01-23 04:30
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 1.9 on 2016-01-26 21:14
|
# Generated by Django 1.9 on 2016-01-26 21:14
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 1.9 on 2016-01-29 22:58
|
# Generated by Django 1.9 on 2016-01-29 22:58
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 1.9 on 2016-02-14 00:40
|
# Generated by Django 1.9 on 2016-02-14 00:40
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 1.9 on 2016-02-27 17:54
|
# Generated by Django 1.9 on 2016-02-27 17:54
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
# Generated by Django 1.9.2 on 2016-03-05 00:40
|
# Generated by Django 1.9.2 on 2016-03-05 00:40
|
||||||
|
|
||||||
import gnupg
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
import gnupg
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
from django.utils.termcolors import colorize as colourise # Spelling hurts me
|
from django.utils.termcolors import colorize as colourise # Spelling hurts me
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
# Generated by Django 1.9.4 on 2016-03-25 21:11
|
# Generated by Django 1.9.4 on 2016-03-25 21:11
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.utils.timezone
|
import django.utils.timezone
|
||||||
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
# Generated by Django 1.9.4 on 2016-03-28 19:09
|
# Generated by Django 1.9.4 on 2016-03-28 19:09
|
||||||
|
|
||||||
import gnupg
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import django.utils.timezone
|
import django.utils.timezone
|
||||||
|
import gnupg
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
from django.template.defaultfilters import slugify
|
from django.template.defaultfilters import slugify
|
||||||
from django.utils.termcolors import colorize as colourise # Spelling hurts me
|
from django.utils.termcolors import colorize as colourise # Spelling hurts me
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 1.10.2 on 2016-10-05 21:38
|
# Generated by Django 1.10.2 on 2016-10-05 21:38
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
# Generated by Django 1.10.5 on 2017-03-25 15:58
|
# Generated by Django 1.10.5 on 2017-03-25 15:58
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 1.10.5 on 2017-05-12 05:07
|
# Generated by Django 1.10.5 on 2017-05-12 05:07
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
# Generated by Django 1.10.5 on 2017-07-15 17:12
|
# Generated by Django 1.10.5 on 2017-07-15 17:12
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
from django.db import migrations, models
|
|
||||||
import django.utils.timezone
|
import django.utils.timezone
|
||||||
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
def set_added_time_to_created_time(apps, schema_editor):
|
def set_added_time_to_created_time(apps, schema_editor):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 1.11.10 on 2018-02-04 13:07
|
# Generated by Django 1.11.10 on 2018-02-04 13:07
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 2.0.8 on 2018-10-07 14:20
|
# Generated by Django 2.0.8 on 2018-10-07 14:20
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
from django.utils.text import slugify
|
from django.utils.text import slugify
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 2.0.10 on 2019-04-26 18:57
|
# Generated by Django 2.0.10 on 2019-04-26 18:57
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
def set_filename(apps, schema_editor):
|
def set_filename(apps, schema_editor):
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
# Generated by Django 3.1.3 on 2020-11-07 12:35
|
# Generated by Django 3.1.3 on 2020-11-07 12:35
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
def logs_set_default_group(apps, schema_editor):
|
def logs_set_default_group(apps, schema_editor):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 3.1.3 on 2020-11-11 11:05
|
# Generated by Django 3.1.3 on 2020-11-11 11:05
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -3,7 +3,8 @@ import os
|
|||||||
|
|
||||||
import magic
|
import magic
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
from paperless.db import GnuPG
|
from paperless.db import GnuPG
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 3.1.3 on 2020-11-29 00:48
|
# Generated by Django 3.1.3 on 2020-11-29 00:48
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
# Generated by Django 3.1.4 on 2020-12-12 14:41
|
# Generated by Django 3.1.4 on 2020-12-12 14:41
|
||||||
|
|
||||||
from django.conf import settings
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
from django.conf import settings
|
||||||
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Generated by Django 3.1.4 on 2020-12-16 17:36
|
# Generated by Django 3.1.4 on 2020-12-16 17:36
|
||||||
|
|
||||||
from django.db import migrations
|
|
||||||
import django.db.models.functions.text
|
import django.db.models.functions.text
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 3.1.4 on 2021-01-01 21:59
|
# Generated by Django 3.1.4 on 2021-01-01 21:59
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
# Generated by Django 3.1.4 on 2021-01-01 23:40
|
# Generated by Django 3.1.4 on 2021-01-01 23:40
|
||||||
|
|
||||||
from django.conf import settings
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
import django.utils.timezone
|
import django.utils.timezone
|
||||||
|
from django.conf import settings
|
||||||
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -8,11 +8,12 @@ from time import sleep
|
|||||||
|
|
||||||
import pathvalidate
|
import pathvalidate
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
from django.template.defaultfilters import slugify
|
from django.template.defaultfilters import slugify
|
||||||
|
|
||||||
from documents.file_handling import defaultdictNoStr, many_to_dictionary
|
from documents.file_handling import defaultdictNoStr
|
||||||
|
from documents.file_handling import many_to_dictionary
|
||||||
|
|
||||||
logger = logging.getLogger("paperless.migrations")
|
logger = logging.getLogger("paperless.migrations")
|
||||||
|
|
||||||
@ -160,11 +161,9 @@ def parse_wrapper(parser, path, mime_type, file_name):
|
|||||||
|
|
||||||
|
|
||||||
def create_archive_version(doc, retry_count=3):
|
def create_archive_version(doc, retry_count=3):
|
||||||
from documents.parsers import (
|
from documents.parsers import DocumentParser
|
||||||
get_parser_class_for_mime_type,
|
from documents.parsers import ParseError
|
||||||
DocumentParser,
|
from documents.parsers import get_parser_class_for_mime_type
|
||||||
ParseError,
|
|
||||||
)
|
|
||||||
|
|
||||||
logger.info(f"Regenerating archive document for document ID:{doc.id}")
|
logger.info(f"Regenerating archive document for document ID:{doc.id}")
|
||||||
parser_class = get_parser_class_for_mime_type(doc.mime_type)
|
parser_class = get_parser_class_for_mime_type(doc.mime_type)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 3.1.4 on 2020-12-02 21:43
|
# Generated by Django 3.1.4 on 2020-12-02 21:43
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
COLOURS_OLD = {
|
COLOURS_OLD = {
|
||||||
1: "#a6cee3",
|
1: "#a6cee3",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 3.1.7 on 2021-02-28 15:14
|
# Generated by Django 3.1.7 on 2021-02-28 15:14
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -3,7 +3,6 @@ import logging
|
|||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger("paperless.migrations")
|
logger = logging.getLogger("paperless.migrations")
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 3.1.7 on 2021-03-17 12:51
|
# Generated by Django 3.1.7 on 2021-03-17 12:51
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 3.2.12 on 2022-03-17 11:59
|
# Generated by Django 3.2.12 on 2022-03-17 11:59
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 4.0.3 on 2022-04-01 22:50
|
# Generated by Django 4.0.3 on 2022-04-01 22:50
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
# Generated by Django 4.0.4 on 2022-05-02 15:56
|
# Generated by Django 4.0.4 on 2022-05-02 15:56
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
# Generated by Django 4.0.4 on 2022-05-07 05:10
|
# Generated by Django 4.0.4 on 2022-05-07 05:10
|
||||||
|
|
||||||
from django.conf import settings
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
from django.conf import settings
|
||||||
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -8,6 +8,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|
||||||
from documents.parsers import run_convert
|
from documents.parsers import run_convert
|
||||||
|
|
||||||
logger = logging.getLogger("paperless.migrations")
|
logger = logging.getLogger("paperless.migrations")
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
# Generated by Django 4.0.4 on 2022-05-23 07:14
|
# Generated by Django 4.0.4 on 2022-05-23 07:14
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
from django.db import migrations, models
|
|
||||||
import django.utils.timezone
|
import django.utils.timezone
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 4.0.6 on 2022-07-25 06:34
|
# Generated by Django 4.0.6 on 2022-07-25 06:34
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 4.0.5 on 2022-08-26 16:49
|
# Generated by Django 4.0.5 on 2022-08-26 16:49
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
# Generated by Django 4.1.1 on 2022-09-27 19:31
|
# Generated by Django 4.1.1 on 2022-09-27 19:31
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
# Generated by Django 4.1.2 on 2022-10-17 16:31
|
# Generated by Django 4.1.2 on 2022-10-17 16:31
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.utils.timezone
|
import django.utils.timezone
|
||||||
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
# Generated by Django 4.1.4 on 2023-01-24 17:56
|
# Generated by Django 4.1.4 on 2023-01-24 17:56
|
||||||
|
|
||||||
import django.core.validators
|
import django.core.validators
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 4.1.5 on 2023-02-03 21:53
|
# Generated by Django 4.1.5 on 2023-02-03 21:53
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
# Generated by Django 4.1.4 on 2022-02-03 04:24
|
# Generated by Django 4.1.4 on 2022-02-03 04:24
|
||||||
|
|
||||||
from django.conf import settings
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
from django.conf import settings
|
||||||
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 4.1.7 on 2023-02-22 00:45
|
# Generated by Django 4.1.7 on 2023-02-22 00:45
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 4.1.5 on 2023-03-04 22:33
|
# Generated by Django 4.1.5 on 2023-03-04 22:33
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 4.1.5 on 2023-03-15 07:10
|
# Generated by Django 4.1.5 on 2023-03-15 07:10
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
# Generated by Django 4.1.5 on 2023-03-17 22:15
|
# Generated by Django 4.1.5 on 2023-03-17 22:15
|
||||||
|
|
||||||
|
import django.db.models.deletion
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
from django.db import models
|
from django.db import models
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -17,6 +17,7 @@ from django.core.validators import MinValueValidator
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from documents.parsers import get_default_file_extension
|
from documents.parsers import get_default_file_extension
|
||||||
|
|
||||||
ALL_STATES = sorted(states.ALL_STATES)
|
ALL_STATES = sorted(states.ALL_STATES)
|
||||||
|
@ -14,6 +14,7 @@ from typing import Set
|
|||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
from documents.loggers import LoggingMixin
|
from documents.loggers import LoggingMixin
|
||||||
from documents.signals import document_consumer_declaration
|
from documents.signals import document_consumer_declaration
|
||||||
|
|
||||||
|
@ -5,9 +5,10 @@ from pathlib import Path
|
|||||||
from typing import Final
|
from typing import Final
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from documents.models import Document
|
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
|
||||||
|
from documents.models import Document
|
||||||
|
|
||||||
|
|
||||||
class SanityCheckMessages:
|
class SanityCheckMessages:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -10,32 +10,30 @@ except ImportError:
|
|||||||
from backports import zoneinfo
|
from backports import zoneinfo
|
||||||
import magic
|
import magic
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.contrib.auth.models import Group
|
||||||
|
from django.contrib.auth.models import User
|
||||||
from django.utils.text import slugify
|
from django.utils.text import slugify
|
||||||
from django.utils.translation import gettext as _
|
from django.utils.translation import gettext as _
|
||||||
|
from guardian.shortcuts import get_users_with_perms
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
from rest_framework.fields import SerializerMethodField
|
from rest_framework.fields import SerializerMethodField
|
||||||
|
|
||||||
|
from documents.permissions import get_groups_with_only_permission
|
||||||
|
from documents.permissions import set_permissions_for_object
|
||||||
|
|
||||||
from . import bulk_edit
|
from . import bulk_edit
|
||||||
from .models import Correspondent
|
from .models import Correspondent
|
||||||
from .models import Document
|
from .models import Document
|
||||||
from .models import DocumentType
|
from .models import DocumentType
|
||||||
from .models import MatchingModel
|
from .models import MatchingModel
|
||||||
|
from .models import PaperlessTask
|
||||||
from .models import SavedView
|
from .models import SavedView
|
||||||
from .models import SavedViewFilterRule
|
from .models import SavedViewFilterRule
|
||||||
from .models import StoragePath
|
from .models import StoragePath
|
||||||
from .models import Tag
|
from .models import Tag
|
||||||
from .models import UiSettings
|
from .models import UiSettings
|
||||||
from .models import PaperlessTask
|
|
||||||
from .parsers import is_mime_type_supported
|
from .parsers import is_mime_type_supported
|
||||||
|
|
||||||
from guardian.shortcuts import get_users_with_perms
|
|
||||||
|
|
||||||
from django.contrib.auth.models import User
|
|
||||||
from django.contrib.auth.models import Group
|
|
||||||
|
|
||||||
from documents.permissions import get_groups_with_only_permission
|
|
||||||
from documents.permissions import set_permissions_for_object
|
|
||||||
|
|
||||||
|
|
||||||
# https://www.django-rest-framework.org/api-guide/serializers/#example
|
# https://www.django-rest-framework.org/api-guide/serializers/#example
|
||||||
class DynamicFieldsModelSerializer(serializers.ModelSerializer):
|
class DynamicFieldsModelSerializer(serializers.ModelSerializer):
|
||||||
|
@ -12,6 +12,10 @@ from channels.layers import get_channel_layer
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
from django.db.models.signals import post_save
|
from django.db.models.signals import post_save
|
||||||
|
from filelock import FileLock
|
||||||
|
from redis.exceptions import ConnectionError
|
||||||
|
from whoosh.writing import AsyncWriter
|
||||||
|
|
||||||
from documents import barcodes
|
from documents import barcodes
|
||||||
from documents import index
|
from documents import index
|
||||||
from documents import sanity_checker
|
from documents import sanity_checker
|
||||||
@ -32,10 +36,6 @@ from documents.models import Tag
|
|||||||
from documents.parsers import DocumentParser
|
from documents.parsers import DocumentParser
|
||||||
from documents.parsers import get_parser_class_for_mime_type
|
from documents.parsers import get_parser_class_for_mime_type
|
||||||
from documents.sanity_checker import SanityCheckFailedException
|
from documents.sanity_checker import SanityCheckFailedException
|
||||||
from filelock import FileLock
|
|
||||||
from redis.exceptions import ConnectionError
|
|
||||||
from whoosh.writing import AsyncWriter
|
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger("paperless.tasks")
|
logger = logging.getLogger("paperless.tasks")
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
from django.contrib.admin.sites import AdminSite
|
from django.contrib.admin.sites import AdminSite
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
from documents import index
|
from documents import index
|
||||||
from documents.admin import DocumentAdmin
|
from documents.admin import DocumentAdmin
|
||||||
from documents.models import Document
|
from documents.models import Document
|
||||||
|
@ -20,30 +20,31 @@ except ImportError:
|
|||||||
from backports import zoneinfo
|
from backports import zoneinfo
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
from dateutil.relativedelta import relativedelta
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.auth.models import Group
|
from django.contrib.auth.models import Group
|
||||||
from django.contrib.auth.models import Permission
|
from django.contrib.auth.models import Permission
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.test import override_settings
|
from django.test import override_settings
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from dateutil.relativedelta import relativedelta
|
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
|
from rest_framework.test import APITestCase
|
||||||
|
from whoosh.writing import AsyncWriter
|
||||||
|
|
||||||
from documents import bulk_edit
|
from documents import bulk_edit
|
||||||
from documents import index
|
from documents import index
|
||||||
from documents.models import Correspondent
|
from documents.models import Correspondent
|
||||||
from documents.models import Document
|
from documents.models import Document
|
||||||
from documents.tests.utils import DocumentConsumeDelayMixin
|
|
||||||
from documents.models import DocumentType
|
from documents.models import DocumentType
|
||||||
from documents.models import MatchingModel
|
from documents.models import MatchingModel
|
||||||
|
from documents.models import Note
|
||||||
from documents.models import PaperlessTask
|
from documents.models import PaperlessTask
|
||||||
from documents.models import SavedView
|
from documents.models import SavedView
|
||||||
from documents.models import StoragePath
|
from documents.models import StoragePath
|
||||||
from documents.models import Tag
|
from documents.models import Tag
|
||||||
from documents.models import Note
|
|
||||||
from documents.tests.utils import DirectoriesMixin
|
from documents.tests.utils import DirectoriesMixin
|
||||||
|
from documents.tests.utils import DocumentConsumeDelayMixin
|
||||||
from paperless import version
|
from paperless import version
|
||||||
from rest_framework.test import APITestCase
|
|
||||||
from whoosh.writing import AsyncWriter
|
|
||||||
|
|
||||||
|
|
||||||
class TestDocumentApi(DirectoriesMixin, DocumentConsumeDelayMixin, APITestCase):
|
class TestDocumentApi(DirectoriesMixin, DocumentConsumeDelayMixin, APITestCase):
|
||||||
|
@ -4,8 +4,10 @@ from unittest import mock
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.test import override_settings
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
from django.test import override_settings
|
||||||
|
from PIL import Image
|
||||||
|
|
||||||
from documents import barcodes
|
from documents import barcodes
|
||||||
from documents import tasks
|
from documents import tasks
|
||||||
from documents.consumer import ConsumerError
|
from documents.consumer import ConsumerError
|
||||||
@ -13,7 +15,6 @@ from documents.data_models import ConsumableDocument
|
|||||||
from documents.data_models import DocumentSource
|
from documents.data_models import DocumentSource
|
||||||
from documents.tests.utils import DirectoriesMixin
|
from documents.tests.utils import DirectoriesMixin
|
||||||
from documents.tests.utils import FileSystemAssertsMixin
|
from documents.tests.utils import FileSystemAssertsMixin
|
||||||
from PIL import Image
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import zxingcpp # noqa: F401
|
import zxingcpp # noqa: F401
|
||||||
|
@ -2,8 +2,9 @@ import textwrap
|
|||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from django.core.checks import Error
|
from django.core.checks import Error
|
||||||
from django.test import override_settings
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
from django.test import override_settings
|
||||||
|
|
||||||
from documents.checks import changed_password_check
|
from documents.checks import changed_password_check
|
||||||
from documents.checks import parser_check
|
from documents.checks import parser_check
|
||||||
from documents.models import Document
|
from documents.models import Document
|
||||||
|
@ -5,8 +5,9 @@ from unittest import mock
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.test import override_settings
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
from django.test import override_settings
|
||||||
|
|
||||||
from documents.classifier import ClassifierModelCorruptError
|
from documents.classifier import ClassifierModelCorruptError
|
||||||
from documents.classifier import DocumentClassifier
|
from documents.classifier import DocumentClassifier
|
||||||
from documents.classifier import IncompatibleClassifierVersionError
|
from documents.classifier import IncompatibleClassifierVersionError
|
||||||
|
@ -15,9 +15,9 @@ except ImportError:
|
|||||||
from backports import zoneinfo
|
from backports import zoneinfo
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils import timezone
|
|
||||||
from django.test import override_settings
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
from django.test import override_settings
|
||||||
|
from django.utils import timezone
|
||||||
|
|
||||||
from documents.consumer import Consumer
|
from documents.consumer import Consumer
|
||||||
from documents.consumer import ConsumerError
|
from documents.consumer import ConsumerError
|
||||||
@ -29,9 +29,10 @@ from documents.models import Tag
|
|||||||
from documents.parsers import DocumentParser
|
from documents.parsers import DocumentParser
|
||||||
from documents.parsers import ParseError
|
from documents.parsers import ParseError
|
||||||
from documents.tasks import sanity_check
|
from documents.tasks import sanity_check
|
||||||
from .utils import DirectoriesMixin
|
|
||||||
from documents.tests.utils import FileSystemAssertsMixin
|
from documents.tests.utils import FileSystemAssertsMixin
|
||||||
|
|
||||||
|
from .utils import DirectoriesMixin
|
||||||
|
|
||||||
|
|
||||||
class TestAttributes(TestCase):
|
class TestAttributes(TestCase):
|
||||||
|
|
||||||
|
@ -5,8 +5,9 @@ from uuid import uuid4
|
|||||||
|
|
||||||
from dateutil import tz
|
from dateutil import tz
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.test import override_settings
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
from django.test import override_settings
|
||||||
|
|
||||||
from documents.parsers import parse_date
|
from documents.parsers import parse_date
|
||||||
from documents.parsers import parse_date_generator
|
from documents.parsers import parse_date_generator
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
from backports import zoneinfo
|
from backports import zoneinfo
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
from django.test import override_settings
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
from documents.models import Correspondent
|
from documents.models import Correspondent
|
||||||
|
@ -7,8 +7,8 @@ from unittest import mock
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.db import DatabaseError
|
from django.db import DatabaseError
|
||||||
from django.test import override_settings
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
from django.test import override_settings
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
from documents.file_handling import create_source_path_directory
|
from documents.file_handling import create_source_path_directory
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
|
import tempfile
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
from django.core.management import call_command
|
||||||
from django.core.management.base import CommandError
|
from django.core.management.base import CommandError
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from documents.settings import EXPORTER_FILE_NAME
|
|
||||||
from documents.settings import EXPORTER_ARCHIVE_NAME
|
|
||||||
from pathlib import Path
|
|
||||||
import tempfile
|
|
||||||
from django.core.management import call_command
|
|
||||||
|
|
||||||
from documents.management.commands.document_importer import Command
|
from documents.management.commands.document_importer import Command
|
||||||
|
from documents.settings import EXPORTER_ARCHIVE_NAME
|
||||||
|
from documents.settings import EXPORTER_FILE_NAME
|
||||||
|
|
||||||
|
|
||||||
class TestImporter(TestCase):
|
class TestImporter(TestCase):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
from documents import index
|
from documents import index
|
||||||
from documents.models import Document
|
from documents.models import Document
|
||||||
from documents.tests.utils import DirectoriesMixin
|
from documents.tests.utils import DirectoriesMixin
|
||||||
|
@ -7,15 +7,15 @@ from pathlib import Path
|
|||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
from django.test import override_settings
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
from django.test import override_settings
|
||||||
|
|
||||||
from documents.file_handling import generate_filename
|
from documents.file_handling import generate_filename
|
||||||
from documents.models import Document
|
from documents.models import Document
|
||||||
from documents.tasks import update_document_archive_file
|
from documents.tasks import update_document_archive_file
|
||||||
from documents.tests.utils import DirectoriesMixin
|
from documents.tests.utils import DirectoriesMixin
|
||||||
from documents.tests.utils import FileSystemAssertsMixin
|
from documents.tests.utils import FileSystemAssertsMixin
|
||||||
|
|
||||||
|
|
||||||
sample_file = os.path.join(os.path.dirname(__file__), "samples", "simple.pdf")
|
sample_file = os.path.join(os.path.dirname(__file__), "samples", "simple.pdf")
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,10 +7,11 @@ from time import sleep
|
|||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.management import call_command
|
|
||||||
from django.core.management import CommandError
|
from django.core.management import CommandError
|
||||||
from django.test import override_settings
|
from django.core.management import call_command
|
||||||
from django.test import TransactionTestCase
|
from django.test import TransactionTestCase
|
||||||
|
from django.test import override_settings
|
||||||
|
|
||||||
from documents.consumer import ConsumerError
|
from documents.consumer import ConsumerError
|
||||||
from documents.data_models import ConsumableDocument
|
from documents.data_models import ConsumableDocument
|
||||||
from documents.management.commands import document_consumer
|
from documents.management.commands import document_consumer
|
||||||
|
@ -9,9 +9,10 @@ from zipfile import ZipFile
|
|||||||
|
|
||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
from django.core.management.base import CommandError
|
from django.core.management.base import CommandError
|
||||||
from django.test import override_settings
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
from django.test import override_settings
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
from documents.management.commands import document_exporter
|
from documents.management.commands import document_exporter
|
||||||
from documents.models import Correspondent
|
from documents.models import Correspondent
|
||||||
from documents.models import Document
|
from documents.models import Document
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
from documents.models import Correspondent
|
from documents.models import Correspondent
|
||||||
from documents.models import Document
|
from documents.models import Document
|
||||||
from documents.models import DocumentType
|
from documents.models import DocumentType
|
||||||
|
@ -5,6 +5,7 @@ from unittest import mock
|
|||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
from documents.tests.utils import DirectoriesMixin
|
from documents.tests.utils import DirectoriesMixin
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ from unittest import mock
|
|||||||
|
|
||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
from documents.management.commands.document_thumbnails import _process_document
|
from documents.management.commands.document_thumbnails import _process_document
|
||||||
from documents.models import Document
|
from documents.models import Document
|
||||||
from documents.tests.utils import DirectoriesMixin
|
from documents.tests.utils import DirectoriesMixin
|
||||||
|
@ -5,8 +5,8 @@ from typing import Iterable
|
|||||||
|
|
||||||
from django.contrib.admin.models import LogEntry
|
from django.contrib.admin.models import LogEntry
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.test import override_settings
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
from django.test import override_settings
|
||||||
|
|
||||||
from documents import matching
|
from documents import matching
|
||||||
from documents.models import Correspondent
|
from documents.models import Correspondent
|
||||||
|
@ -6,12 +6,12 @@ from unittest import mock
|
|||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.test import override_settings
|
from django.test import override_settings
|
||||||
|
|
||||||
from documents.parsers import ParseError
|
from documents.parsers import ParseError
|
||||||
from documents.tests.utils import DirectoriesMixin
|
from documents.tests.utils import DirectoriesMixin
|
||||||
from documents.tests.utils import FileSystemAssertsMixin
|
from documents.tests.utils import FileSystemAssertsMixin
|
||||||
from documents.tests.utils import TestMigrations
|
from documents.tests.utils import TestMigrations
|
||||||
|
|
||||||
|
|
||||||
STORAGE_TYPE_GPG = "gpg"
|
STORAGE_TYPE_GPG = "gpg"
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ import shutil
|
|||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.test import override_settings
|
from django.test import override_settings
|
||||||
|
|
||||||
from documents.parsers import get_default_file_extension
|
from documents.parsers import get_default_file_extension
|
||||||
from documents.tests.utils import DirectoriesMixin
|
from documents.tests.utils import DirectoriesMixin
|
||||||
from documents.tests.utils import TestMigrations
|
from documents.tests.utils import TestMigrations
|
||||||
|
@ -7,6 +7,7 @@ from typing import Union
|
|||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from django.test import override_settings
|
from django.test import override_settings
|
||||||
|
|
||||||
from documents.tests.utils import TestMigrations
|
from documents.tests.utils import TestMigrations
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ from django.test import TestCase
|
|||||||
|
|
||||||
from documents.models import Correspondent
|
from documents.models import Correspondent
|
||||||
from documents.models import Document
|
from documents.models import Document
|
||||||
|
|
||||||
from .factories import CorrespondentFactory
|
from .factories import CorrespondentFactory
|
||||||
from .factories import DocumentFactory
|
from .factories import DocumentFactory
|
||||||
|
|
||||||
|
@ -2,8 +2,9 @@ from tempfile import TemporaryDirectory
|
|||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from django.apps import apps
|
from django.apps import apps
|
||||||
from django.test import override_settings
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
from django.test import override_settings
|
||||||
|
|
||||||
from documents.parsers import get_default_file_extension
|
from documents.parsers import get_default_file_extension
|
||||||
from documents.parsers import get_parser_class_for_mime_type
|
from documents.parsers import get_parser_class_for_mime_type
|
||||||
from documents.parsers import get_supported_file_extensions
|
from documents.parsers import get_supported_file_extensions
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user