2018-01-28 13:17:11 +00:00
|
|
|
from pkg_resources import get_distribution, DistributionNotFound
|
|
|
|
|
|
|
|
|
|
try:
|
2018-01-28 13:57:35 +00:00
|
|
|
__version__ = get_distribution('django-authority').version
|
2018-01-28 13:17:11 +00:00
|
|
|
except DistributionNotFound:
|
|
|
|
|
# package is not installed
|
|
|
|
|
pass
|
|
|
|
|
|
2009-06-08 10:00:44 +00:00
|
|
|
LOADING = False
|
|
|
|
|
|
2016-03-29 17:24:31 +00:00
|
|
|
|
2009-06-08 10:00:44 +00:00
|
|
|
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
|
|
|
|
|
|
2016-07-27 16:41:25 +00:00
|
|
|
from authority import utils
|
|
|
|
|
utils.autodiscover_modules()
|