Skip to content

Commit

Permalink
彻底修复init_permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Singein committed Apr 6, 2021
1 parent de0ed3c commit 9d48fba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CHANGES
=======

* 修改init\_permissions中app\_models的作用域
* 修改init\_permissions
* 修改类名
* docs(ChangeLog): update ChangeLog about version[0.9.14]
Expand Down
4 changes: 2 additions & 2 deletions DjangoAppCenter/extensions/apps/permission_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ def init_permissions(self):
return

for key, value in app_models.__dict__.items():
nonlocal app_models

if not isinstance(value, type):
continue

elif issubclass(value, [eval("app_models.%s" % m) for m in self.base_orm_models]):
elif issubclass(value, tuple([app_models.__dict__[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 9d48fba

Please sign in to comment.