Move smart_settings links to a separate file
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from project_setup.api import register_setup
|
||||
from navigation.api import Link
|
||||
|
||||
|
||||
def is_superuser(context):
|
||||
return context['request'].user.is_staff or context['request'].user.is_superuser
|
||||
|
||||
check_settings = Link(text=_(u'settings'), view='setting_list', sprite='cog', icon='cog.png', condition=is_superuser, children_view_regex=[r'^setting_'])
|
||||
from .links import check_settings
|
||||
|
||||
register_setup(check_settings)
|
||||
|
||||
9
apps/smart_settings/links.py
Normal file
9
apps/smart_settings/links.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
|
||||
|
||||
def is_superuser(context):
|
||||
return context['request'].user.is_staff or context['request'].user.is_superuser
|
||||
|
||||
check_settings = Link(text=_(u'settings'), view='setting_list', sprite='cog', icon='cog.png', condition=is_superuser, children_view_regex=[r'^setting_'])
|
||||
Reference in New Issue
Block a user