diff --git a/gunicorn.conf.py b/gunicorn.conf.py index 70c5707e1..0e3878f8b 100644 --- a/gunicorn.conf.py +++ b/gunicorn.conf.py @@ -3,7 +3,7 @@ import os # See https://docs.gunicorn.org/en/stable/settings.html for # explanations of settings -bind = f'{os.getenv("PAPERLESS_BIND_ADDR", "[::]")}:{os.getenv("PAPERLESS_PORT", 8000)}' +bind = f"{os.getenv('PAPERLESS_BIND_ADDR', '[::]')}:{os.getenv('PAPERLESS_PORT', 8000)}" workers = int(os.getenv("PAPERLESS_WEBSERVER_WORKERS", 1)) worker_class = "paperless.workers.ConfigurableWorker" diff --git a/src/documents/checks.py b/src/documents/checks.py index a97c517aa..8f8fbf4f9 100644 --- a/src/documents/checks.py +++ b/src/documents/checks.py @@ -32,8 +32,7 @@ def changed_password_check(app_configs, **kwargs): if not settings.PASSPHRASE: return [ Error( - "The database contains encrypted documents but no password " - "is set.", + "The database contains encrypted documents but no password is set.", ), ] diff --git a/src/documents/classifier.py b/src/documents/classifier.py index b3e71711c..72bf1f16c 100644 --- a/src/documents/classifier.py +++ b/src/documents/classifier.py @@ -315,8 +315,7 @@ class DocumentClassifier: else: self.correspondent_classifier = None logger.debug( - "There are no correspondents. Not training correspondent " - "classifier.", + "There are no correspondents. Not training correspondent classifier.", ) if num_document_types > 0: @@ -326,8 +325,7 @@ class DocumentClassifier: else: self.document_type_classifier = None logger.debug( - "There are no document types. Not training document type " - "classifier.", + "There are no document types. Not training document type classifier.", ) if num_storage_paths > 0: diff --git a/src/documents/management/commands/decrypt_documents.py b/src/documents/management/commands/decrypt_documents.py index aa8e7d184..793cac4bb 100644 --- a/src/documents/management/commands/decrypt_documents.py +++ b/src/documents/management/commands/decrypt_documents.py @@ -18,8 +18,7 @@ class Command(BaseCommand): parser.add_argument( "--passphrase", help=( - "If PAPERLESS_PASSPHRASE isn't set already, you need to " - "specify it here" + "If PAPERLESS_PASSPHRASE isn't set already, you need to specify it here" ), ) diff --git a/src/documents/tests/test_api_search.py b/src/documents/tests/test_api_search.py index e524e7b91..118862979 100644 --- a/src/documents/tests/test_api_search.py +++ b/src/documents/tests/test_api_search.py @@ -96,7 +96,7 @@ class TestDocumentSearchApi(DirectoriesMixin, APITestCase): doc = Document.objects.create( checksum=str(i), pk=i + 1, - title=f"Document {i+1}", + title=f"Document {i + 1}", content="content", ) index.update_document(writer, doc) @@ -131,7 +131,7 @@ class TestDocumentSearchApi(DirectoriesMixin, APITestCase): doc = Document.objects.create( checksum=str(i), pk=i + 1, - title=f"Document {i+1}", + title=f"Document {i + 1}", content="content", ) index.update_document(writer, doc) @@ -630,8 +630,8 @@ class TestDocumentSearchApi(DirectoriesMixin, APITestCase): doc = Document.objects.create( checksum=str(i), pk=i + 1, - title=f"Document {i+1}", - content=f"Things document {i+1}", + title=f"Document {i + 1}", + content=f"Things document {i + 1}", ) index.update_document(writer, doc) diff --git a/src/documents/tests/utils.py b/src/documents/tests/utils.py index cd4db84e6..739433bb6 100644 --- a/src/documents/tests/utils.py +++ b/src/documents/tests/utils.py @@ -295,9 +295,9 @@ class TestMigrations(TransactionTestCase): def setUp(self): super().setUp() - assert ( - self.migrate_from and self.migrate_to - ), f"TestCase '{type(self).__name__}' must define migrate_from and migrate_to properties" + assert self.migrate_from and self.migrate_to, ( + f"TestCase '{type(self).__name__}' must define migrate_from and migrate_to properties" + ) self.migrate_from = [(self.app, self.migrate_from)] if self.dependencies is not None: self.migrate_from.extend(self.dependencies) diff --git a/src/paperless_mail/mail.py b/src/paperless_mail/mail.py index 7809c7389..e25c4f227 100644 --- a/src/paperless_mail/mail.py +++ b/src/paperless_mail/mail.py @@ -552,8 +552,7 @@ class MailAccountHandler(LoggingMixin): mailbox_login(M, account) self.log.debug( - f"Account {account}: Processing " - f"{account.rules.count()} rule(s)", + f"Account {account}: Processing {account.rules.count()} rule(s)", ) for rule in account.rules.order_by("order"): diff --git a/src/paperless_mail/tests/test_parsers_live.py b/src/paperless_mail/tests/test_parsers_live.py index 9e13ad25e..e1febb1e5 100644 --- a/src/paperless_mail/tests/test_parsers_live.py +++ b/src/paperless_mail/tests/test_parsers_live.py @@ -129,9 +129,11 @@ class TestParserLive: assert thumb.exists() assert thumb.is_file() - assert ( - self.imagehash(thumb) == self.imagehash(simple_txt_email_thumbnail_file) - ), f"Created Thumbnail {thumb} differs from expected file {simple_txt_email_thumbnail_file}" + assert self.imagehash(thumb) == self.imagehash( + simple_txt_email_thumbnail_file, + ), ( + f"Created Thumbnail {thumb} differs from expected file {simple_txt_email_thumbnail_file}" + ) def test_tika_parse_successful(self, mail_parser: MailDocumentParser): """ @@ -226,6 +228,6 @@ class TestParserLive: # The created pdf is not reproducible. But the converted image should always look the same. expected_hash = self.imagehash(html_email_thumbnail_file) - assert ( - generated_thumbnail_hash == expected_hash - ), f"PDF looks different. Check if {generated_thumbnail} looks weird." + assert generated_thumbnail_hash == expected_hash, ( + f"PDF looks different. Check if {generated_thumbnail} looks weird." + ) diff --git a/src/paperless_tesseract/parsers.py b/src/paperless_tesseract/parsers.py index 28b052614..e7968a61e 100644 --- a/src/paperless_tesseract/parsers.py +++ b/src/paperless_tesseract/parsers.py @@ -455,8 +455,7 @@ class RasterisedDocumentParser(DocumentParser): self.text = text_original else: self.log.warning( - f"No text was found in {document_path}, the content will " - f"be empty.", + f"No text was found in {document_path}, the content will be empty.", ) self.text = ""