2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 21:15:41 +00:00

Reload settings values "live" (without a page refresh)

This commit is contained in:
Oliver
2021-07-27 17:03:37 +10:00
parent 46d5a6f00b
commit 990b987692
3 changed files with 47 additions and 10 deletions

View File

@ -50,6 +50,23 @@ class SettingEdit(AjaxUpdateView):
return ctx
def get_data(self):
"""
Custom data to return to the client after POST success
"""
data = {}
setting = self.get_object()
data['pk'] = setting.pk
data['key'] = setting.key
data['value'] = setting.value
data['is_bool'] = setting.is_bool()
data['is_int'] = setting.is_int()
return data
def get_form(self):
"""
Override default get_form behaviour