From c029ccb7ad80f415fb3831bf5fc9dce217d8ee97 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 21 Feb 2019 15:07:06 +0100 Subject: [PATCH] Also feed the setting name when calling setting hook --- src/yunohost/settings.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/yunohost/settings.py b/src/yunohost/settings.py index cb98fa57e..81ea46114 100644 --- a/src/yunohost/settings.py +++ b/src/yunohost/settings.py @@ -264,7 +264,7 @@ def trigger_post_change_hook(setting_name, old_value, new_value): return f = post_change_hooks[setting_name] - f(old_value, new_value) + f(setting_name, old_value, new_value) # =========================================== @@ -273,14 +273,15 @@ def trigger_post_change_hook(setting_name, old_value, new_value): # You can define such an action with : # # @post_change_hook("your.setting.name") -# def some_function_name(old_value, new_value): +# def some_function_name(setting_name, old_value, new_value): # # Do some stuff # # =========================================== #@post_change_hook("example.int") -#def myfunc(old_value, new_value): +#def myfunc(setting_name, old_value, new_value): # print("In hook") +# print(setting_name) # print(old_value) # print(new_value)