Move sentry and admin link registration to common app
This commit is contained in:
+10
-1
@@ -7,15 +7,18 @@ from django.contrib.auth import models as auth_models
|
||||
from django.contrib.auth.management import create_superuser
|
||||
from django.dispatch import receiver
|
||||
from django.db.models.signals import post_syncdb
|
||||
from django.conf import settings
|
||||
|
||||
from navigation.api import bind_links, register_top_menu, Link
|
||||
from project_setup.api import register_setup
|
||||
from project_tools.api import register_tool
|
||||
|
||||
from .conf.settings import (AUTO_CREATE_ADMIN, AUTO_ADMIN_USERNAME,
|
||||
AUTO_ADMIN_PASSWORD, TEMPORARY_DIRECTORY)
|
||||
from .conf import settings as common_settings
|
||||
from .utils import validate_path
|
||||
from .links import (password_change_view, current_user_details,
|
||||
current_user_edit, about_view, license_view)
|
||||
current_user_edit, about_view, license_view, admin_site, sentry)
|
||||
|
||||
bind_links(['about_view', 'license_view'], [about_view, license_view], menu_name='secondary_menu')
|
||||
bind_links(['current_user_details', 'current_user_edit', 'password_change_view'], [current_user_details, current_user_edit, password_change_view], menu_name='secondary_menu')
|
||||
@@ -49,3 +52,9 @@ def create_superuser_processor(sender, **kwargs):
|
||||
|
||||
if (validate_path(TEMPORARY_DIRECTORY) == False) or (not TEMPORARY_DIRECTORY):
|
||||
setattr(common_settings, 'TEMPORARY_DIRECTORY', tempfile.mkdtemp())
|
||||
|
||||
if 'django.contrib.admin' in settings.INSTALLED_APPS:
|
||||
register_setup(admin_site)
|
||||
|
||||
if 'sentry' in settings.INSTALLED_APPS:
|
||||
register_tool(sentry)
|
||||
|
||||
Reference in New Issue
Block a user