mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Chore: Change the code formatter to Ruff (#6756)
* Changing the formatting to ruff-format * Replaces references to black to ruff or ruff format, removes black from dependencies
This commit is contained in:
@@ -6,7 +6,6 @@ from django.db import models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("paperless", "0002_applicationconfiguration_app_logo_and_more"),
|
||||
]
|
||||
|
@@ -171,8 +171,7 @@ def _parse_beat_schedule() -> dict:
|
||||
"task": "paperless_mail.tasks.process_mail_accounts",
|
||||
"options": {
|
||||
# 1 minute before default schedule sends again
|
||||
"expires": 9.0
|
||||
* 60.0,
|
||||
"expires": 9.0 * 60.0,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -183,8 +182,7 @@ def _parse_beat_schedule() -> dict:
|
||||
"task": "documents.tasks.train_classifier",
|
||||
"options": {
|
||||
# 1 minute before default schedule sends again
|
||||
"expires": 59.0
|
||||
* 60.0,
|
||||
"expires": 59.0 * 60.0,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -195,9 +193,7 @@ def _parse_beat_schedule() -> dict:
|
||||
"task": "documents.tasks.index_optimize",
|
||||
"options": {
|
||||
# 1 hour before default schedule sends again
|
||||
"expires": 23.0
|
||||
* 60.0
|
||||
* 60.0,
|
||||
"expires": 23.0 * 60.0 * 60.0,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -208,9 +204,7 @@ def _parse_beat_schedule() -> dict:
|
||||
"task": "documents.tasks.sanity_check",
|
||||
"options": {
|
||||
# 1 hour before default schedule sends again
|
||||
"expires": ((7.0 * 24.0) - 1.0)
|
||||
* 60.0
|
||||
* 60.0,
|
||||
"expires": ((7.0 * 24.0) - 1.0) * 60.0 * 60.0,
|
||||
},
|
||||
},
|
||||
]
|
||||
@@ -822,9 +816,9 @@ CACHES = {
|
||||
}
|
||||
|
||||
if DEBUG and os.getenv("PAPERLESS_CACHE_BACKEND") is None:
|
||||
CACHES["default"][
|
||||
"BACKEND"
|
||||
] = "django.core.cache.backends.locmem.LocMemCache" # pragma: no cover
|
||||
CACHES["default"]["BACKEND"] = (
|
||||
"django.core.cache.backends.locmem.LocMemCache" # pragma: no cover
|
||||
)
|
||||
|
||||
|
||||
def default_threads_per_worker(task_workers) -> int:
|
||||
|
@@ -29,7 +29,6 @@ class TestCustomAccountAdapter(TestCase):
|
||||
with context.request_context(request):
|
||||
adapter = get_adapter()
|
||||
with override_settings(ALLOWED_HOSTS=["*"]):
|
||||
|
||||
# True because request host is same
|
||||
url = "https://example.com"
|
||||
self.assertTrue(adapter.is_safe_url(url))
|
||||
|
Reference in New Issue
Block a user