Permalink
Browse files

Support for Django 1.9 in autodiscover() -> use django.utils.module_l…

…oading.autodiscover_modules
  • Loading branch information...
jpic committed Apr 23, 2015
1 parent 8fe25b2 commit 485af2c37b7b9716c02b99096d9fc3178400c529
Showing with 9 additions and 1 deletion.
  1. +9 −1 rules_light/registry.py
View
@@ -14,6 +14,11 @@
from django.utils.encoding import smart_text
try:
from django.utils.module_loading import autodiscover_modules
except ImportError:
autodiscover_modules = None
from .exceptions import Denied, DoesNotExist
__all__ = ('RuleRegistry', 'registry', 'require', 'run', 'autodiscover')
@@ -184,4 +189,7 @@ def autodiscover():
`'cities_light.city.read'` and `'cities_light.city.update'` will be
registered.
"""
_autodiscover(registry)
if autodiscover_modules:
autodiscover_modules('rules_light_registry')
else:
_autodiscover(registry)

0 comments on commit 485af2c

Please sign in to comment.