mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
infinoted: Add service only when setup is completed
- Inline with recent changes done.
This commit is contained in:
parent
fb8ac3b748
commit
414a59856d
@ -59,12 +59,14 @@ def init():
|
||||
menu.add_urlname(title, 'glyphicon-pencil', 'infinoted:index')
|
||||
|
||||
global service
|
||||
service = service_module.Service(
|
||||
managed_services[0], title, ports=['infinoted-plinth'],
|
||||
is_external=True, enable=enable, disable=disable)
|
||||
setup_helper = globals()['setup_helper']
|
||||
if setup_helper.get_state() != 'needs-setup':
|
||||
service = service_module.Service(
|
||||
managed_services[0], title, ports=['infinoted-plinth'],
|
||||
is_external=True, enable=enable, disable=disable)
|
||||
|
||||
if service.is_enabled():
|
||||
add_shortcut()
|
||||
if service.is_enabled():
|
||||
add_shortcut()
|
||||
|
||||
|
||||
class InfinotedServiceView(ServiceView):
|
||||
@ -77,6 +79,12 @@ def setup(helper, old_version=None):
|
||||
"""Install and configure the module."""
|
||||
helper.install(managed_packages)
|
||||
helper.call('post', actions.superuser_run, 'infinoted', ['setup'])
|
||||
global service
|
||||
if service is None:
|
||||
service = service_module.Service(
|
||||
managed_services[0], title, ports=['infinoted-plinth'],
|
||||
is_external=True, enable=enable, disable=disable)
|
||||
|
||||
helper.call('post', service.notify_enabled, None, True)
|
||||
helper.call('post', add_shortcut)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user