upgrades: Finish the reorganisation of views

This commit is contained in:
Sunil Mohan Adapa 2015-09-02 19:21:45 +05:30
parent c539dc6db3
commit 114370c2e0
3 changed files with 11 additions and 12 deletions

View File

@ -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)

View File

@ -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'),

View File

@ -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'])