django-orchestra/orchestra/contrib/accounts/apps.py

27 lines
1.1 KiB
Python
Raw Normal View History

2023-07-09 07:51:51 +00:00
from django.apps import AppConfig
from django.db.models.signals import post_migrate
from django.utils.translation import gettext_lazy as _
from orchestra.core import services, accounts
class AccountConfig(AppConfig):
name = 'orchestra.contrib.accounts'
verbose_name = _("Accounts")
def ready(self):
from .management import create_initial_superuser
from .models import Account
services.register(Account, menu=False, dashboard=False)
accounts.register(Account, icon='Face-monkey.png')
post_migrate.connect(create_initial_superuser,
dispatch_uid="orchestra.contrib.accounts.management.createsuperuser")
2023-09-18 07:09:43 +00:00
# from oauth2_provider.models import Grant, AccessToken, RefreshToken, IDToken, Application
# accounts.register(Grant, dashboard=False)
# accounts.register(AccessToken, parent=Grant, dashboard=False)
# accounts.register(RefreshToken, parent=Grant, dashboard=False)
# accounts.register(IDToken, parent=Grant, dashboard=False)
# accounts.register(Application, parent=Grant, dashboard=False)