Skip to content

Commit

Permalink
fix typings
Browse files Browse the repository at this point in the history
  • Loading branch information
devkral committed Jan 12, 2025
1 parent fbb8dc6 commit d6d6b87
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion edgy/contrib/autoreflection/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class AutoReflectModel(edgy.ReflectModel, metaclass=AutoReflectionMeta):
meta: ClassVar[AutoReflectionMetaInfo]

@classmethod
def real_add_to_registry(cls: type["BaseModelType"], **kwargs: Any) -> type["BaseModelType"]:
def real_add_to_registry(cls, **kwargs: Any) -> type["BaseModelType"]:
if isinstance(cls.meta, AutoReflectionMetaInfo):
kwargs.setdefault("registry_type_name", "pattern_models")
return super().real_add_to_registry(**kwargs)
8 changes: 4 additions & 4 deletions edgy/contrib/multi_tenancy/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class TenantModel(Model, metaclass=BaseTenantMeta):
meta: ClassVar[TenantMeta] = TenantMeta(None, abstract=True)

@classmethod
def real_add_to_registry(cls: type["BaseModelType"], **kwargs: Any) -> type["BaseModelType"]:
def real_add_to_registry(cls, **kwargs: Any) -> type["BaseModelType"]:
result = super().real_add_to_registry(**kwargs)

if (
Expand All @@ -30,9 +30,9 @@ def real_add_to_registry(cls: type["BaseModelType"], **kwargs: Any) -> type["Bas
and not cls.meta.abstract
and not cls.__is_proxy_model__
):
assert (
cls.__reflected__ is False
), "Reflected models are not compatible with multi_tenancy"
assert cls.__reflected__ is False, (
"Reflected models are not compatible with multi_tenancy"
)

if not cls.meta.register_default:
# remove from models
Expand Down
2 changes: 1 addition & 1 deletion edgy/core/db/models/mixins/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def create_through_model(x: Any, field: BaseFieldType = value) -> None:

@classmethod
def add_to_registry(
cls: type[BaseModelType],
cls,
registry: Registry,
name: str = "",
database: Union[bool, Database, Literal["keep"]] = "keep",
Expand Down

0 comments on commit d6d6b87

Please sign in to comment.