run lint on 3.12

This commit is contained in:
Your Name 2024-05-29 10:50:41 -04:00 committed by Henri Dickson
parent eff338f356
commit 5d88282f4e
5 changed files with 229 additions and 237 deletions

View file

@ -1,23 +0,0 @@
class SoftDeleteMixin:
"""
SoftDeleteMixin
Model must add this:
is_deleted = models.BooleanField(default=False, db_index=True)
Model may override this:
def clear(self):
pass
"""
def clear(self):
pass
def delete(self, using=None, keep_parents=False, soft=True, *args, **kwargs):
if soft:
self.clear()
self.is_deleted = True
self.save(using=using) # type: ignore
return 0, {}
else:
return super().delete(using=using, keep_parents=keep_parents, *args, **kwargs) # type: ignore

View file

@ -6,7 +6,6 @@ import django.db.models.deletion
import simple_history.models
from django.db import migrations, models
import catalog.common.mixins
import catalog.common.utils
@ -213,7 +212,7 @@ class Migration(migrations.Migration):
("edited_time", models.DateTimeField(auto_now=True)),
("is_deleted", models.BooleanField(db_index=True, default=False)),
],
bases=(catalog.common.mixins.SoftDeleteMixin, models.Model),
bases=(models.Model,),
),
migrations.CreateModel(
name="Album",

View file

@ -1,6 +1,5 @@
from auditlog.registry import auditlog
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from loguru import logger
from .book.models import Edition, EditionInSchema, EditionSchema, Series, Work
@ -101,11 +100,6 @@ def init_catalog_audit_log():
__all__ = [
"Edition",
"EditionInSchema",
"EditionSchema",
"Series",
"Work",
"CatalogCollection",
"AvailableItemCategory",
"ExternalResource",
@ -118,6 +112,11 @@ __all__ = [
"SiteName",
"item_categories",
"item_content_types",
"Edition",
"EditionInSchema",
"EditionSchema",
"Series",
"Work",
"Game",
"GameInSchema",
"GameSchema",

File diff suppressed because it is too large Load diff

View file

@ -1,17 +1,6 @@
[tool.pyright]
exclude = [ "media", ".venv", ".git", "playground", "catalog/*/tests.py", "journal/tests.py", "neodb", "**/migrations", "**/sites/douban_*", "neodb-takahe" ]
reportIncompatibleVariableOverride = false
reportUnusedImport = false
reportUnknownVariableType = false
reportConstantRedefinition = false
reportUnusedCallResult = false
reportUnknownMemberType = false
reportUnknownArgumentType = false
reportAny = false
reportImplicitOverride = false
reportUninitializedInstanceVariable = false
reportMissingTypeStubs = false
reportIgnoreCommentWithoutRule = false
[tool.djlint]
ignore="T002,T003,H005,H006,H019,H020,H021,H023,H030,H031,D018"