mirror of
https://github.com/jazzband/django-authority.git
synced 2026-04-14 04:00:59 +00:00
1. All models need to be defined inside an installed application or declare an explicit app_label. Furthermore, it isn’t possible to import them before their application is loaded. In particular, it isn’t possible to import models inside the root package of an application 2. The django.contrib.contenttypes.generic module is removed 3. django.db.models.loading is removed.
15 lines
337 B
Python
15 lines
337 B
Python
LOADING = False
|
|
|
|
|
|
def autodiscover():
|
|
"""
|
|
Goes and imports the permissions submodule of every app in INSTALLED_APPS
|
|
to make sure the permission set classes are registered correctly.
|
|
"""
|
|
global LOADING
|
|
if LOADING:
|
|
return
|
|
LOADING = True
|
|
|
|
from authority import utils
|
|
utils.autodiscover_modules()
|