mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
Service object to handle services on a system-level
The Service object now offers handling services on a system level, and gathering information whether it's enabled or running. New methods: enable, disable, is_enabled, is_running; For this it needs the correct (system-level) service name. All of the methods can be overridden/customized. This changes all modules to the new Service object and deletes action scripts that are not required anymore.
This commit is contained in:
1 parent
9fe49f881f
commit
a9528c56d9
30 files changed
+243
-629
No files matched your search
@@ -40,10 +40,11 @@ class ConfigurationView(views.ConfigurationView):
|
||||
modified = False
|
||||
|
||||
if old_status['enabled'] != new_status['enabled']:
|
||||
sub_command = 'enable' if new_status['enabled'] else 'disable'
|
||||
if new_status['enabled']:
|
||||
datetime.service.enable()
|
||||
else:
|
||||
datetime.service.disable()
|
||||
modified = True
|
||||
actions.superuser_run('datetime', [sub_command])
|
||||
datetime.service.notify_enabled(None, new_status['enabled'])
|
||||
messages.success(self.request, _('Configuration updated'))
|
||||
|
||||
if old_status['time_zone'] != new_status['time_zone'] and \
|
||||
|
||||
Reference in new issue
Block a user