diff --git a/mayan/apps/acls/apps.py b/mayan/apps/acls/apps.py index 313d0ab290..a86efadb28 100644 --- a/mayan/apps/acls/apps.py +++ b/mayan/apps/acls/apps.py @@ -19,7 +19,7 @@ from .models import CreatorSingleton def create_creator_user(sender, **kwargs): - if kwargs.get('app') == 'acls': + if kwargs['app_config'].__class__ == ACLsApp: CreatorSingleton.objects.get_or_create() diff --git a/mayan/apps/common/apps.py b/mayan/apps/common/apps.py index fdefd00db9..f010207edd 100644 --- a/mayan/apps/common/apps.py +++ b/mayan/apps/common/apps.py @@ -29,6 +29,8 @@ from .settings import ( ) from .utils import validate_path +logger = logging.getLogger(__name__) + def create_superuser_and_anonymous_user(sender, **kwargs): """ @@ -41,7 +43,7 @@ def create_superuser_and_anonymous_user(sender, **kwargs): Create our own admin super user automatically. """ - if kwargs.get('app') == 'common': + if kwargs['app_config'].__class__ == CommonApp: AutoAdminSingleton.objects.get_or_create() AnonymousUserSingleton.objects.get_or_create() @@ -91,8 +93,6 @@ class CommonApp(apps.AppConfig): verbose_name = _('Common') def ready(self): - logger = logging.getLogger(__name__) - register_links(['common:current_user_details', 'common:current_user_edit', 'common:current_user_locale_profile_details', 'common:current_user_locale_profile_edit', 'common:password_change_view'], [link_current_user_details, link_current_user_edit, link_current_user_locale_profile_details, link_current_user_locale_profile_edit, link_password_change, link_logout], menu_name='secondary_menu') register_links(['common:about_view', 'common:license_view'], [link_about, link_license], menu_name='secondary_menu')