models: initialize plugins there
This commit is contained in:
parent
4c21a7bab5
commit
c1fd142f8e
|
@ -21,8 +21,9 @@ except ImportError:
|
|||
from django.contrib.contenttypes.models import ContentType
|
||||
|
||||
|
||||
from . import managers
|
||||
from . import managers, plugins
|
||||
|
||||
plugins.init()
|
||||
|
||||
class UserManager(BaseUserManager):
|
||||
def create_user(self, username, email=None, password=None, **extra_fields):
|
||||
|
|
|
@ -126,3 +126,8 @@ def register_plugins_idp_backends(idp_backends,
|
|||
if cls not in idp_backends:
|
||||
idp_backends.append(cls)
|
||||
return tuple(idp_backends)
|
||||
|
||||
def init():
|
||||
for plugin in get_plugins():
|
||||
if hasattr(plugin, 'init'):
|
||||
plugin.init()
|
||||
|
|
Loading…
Reference in New Issue