Skip to content

Commit

Permalink
修改类名
Browse files Browse the repository at this point in the history
  • Loading branch information
Singein committed Apr 6, 2021
1 parent 10aa118 commit b963eb1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
CHANGES
=======

* docs(ChangeLog): update ChangeLog about version[0.9.14]

v0.9.14
-------

Expand Down
10 changes: 4 additions & 6 deletions DjangoAppCenter/extensions/apps/permission_init.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import logging
from importlib import import_module

from django.db import models

logger = logging.getLogger("PermissionInit")


class PermissionInit:
models_path = ""
base_orm_models = (models.Model,)
class PermissionInitMixin:
models_path: str = ""
base_orm_models: tuple[str] = ("models.Model",)

def ready(self):
self.init_permissions()
Expand All @@ -27,7 +25,7 @@ def init_permissions(self):
if not isinstance(value, type):
continue

elif issubclass(value, self.base_orm_models):
elif issubclass(value, [eval(m) for m in self.base_orm_models]):
if hasattr(value, "_meta") and value._meta.abstract is True:
continue
if not ContentType.objects.filter(app_label=self.name).filter(model=key.lower()).exists():
Expand Down

0 comments on commit b963eb1

Please sign in to comment.