diff --git a/plinth/modules/upgrades/__init__.py b/plinth/modules/upgrades/__init__.py index 24066ee4a..ca811bc99 100644 --- a/plinth/modules/upgrades/__init__.py +++ b/plinth/modules/upgrades/__init__.py @@ -19,9 +19,16 @@ Plinth module for upgrades """ -from . import upgrades -from .upgrades import init +from gettext import gettext as _ + +from plinth import cfg -__all__ = ['upgrades', 'init'] depends = ['plinth.modules.system'] + + +def init(): + """Initialize the module.""" + menu = cfg.main_menu.get('system:index') + menu.add_urlname(_('Software Upgrades'), 'glyphicon-refresh', + 'upgrades:index', 21) diff --git a/plinth/modules/upgrades/urls.py b/plinth/modules/upgrades/urls.py index fa54bedb2..b7bfb3b96 100644 --- a/plinth/modules/upgrades/urls.py +++ b/plinth/modules/upgrades/urls.py @@ -23,7 +23,7 @@ from django.conf.urls import patterns, url urlpatterns = patterns( - 'plinth.modules.upgrades.upgrades', + 'plinth.modules.upgrades.views', url(r'^sys/upgrades/$', 'index', name='index'), url(r'^sys/upgrades/upgrade/$', 'upgrade', name='upgrade'), url(r'^sys/upgrades/upgrade/run/$', 'run', name='run'), diff --git a/plinth/modules/upgrades/views.py b/plinth/modules/upgrades/views.py index b3145383a..259b18352 100644 --- a/plinth/modules/upgrades/views.py +++ b/plinth/modules/upgrades/views.py @@ -27,7 +27,6 @@ from gettext import gettext as _ from .forms import ConfigureForm from plinth import actions -from plinth import cfg from plinth import package from plinth.errors import ActionError @@ -37,13 +36,6 @@ subsubmenu = [{'url': reverse_lazy('upgrades:index'), 'text': _('Upgrade Packages')}] -def init(): - """Initialize the module.""" - menu = cfg.main_menu.get('system:index') - menu.add_urlname(_('Software Upgrades'), 'glyphicon-refresh', - 'upgrades:index', 21) - - def on_install(): """Enable automatic upgrades after install.""" actions.superuser_run('upgrades', ['enable-auto'])