Move sentry and admin link registration to common app

This commit is contained in:
Roberto Rosario
2012-06-08 18:20:43 -04:00
parent de8c690934
commit c1d7acb6e3
3 changed files with 18 additions and 7 deletions
+10 -1
View File
@@ -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)