Completed basic handling of authentication settings save process to the database.

This commit is contained in:
Matt Scott
2023-04-10 13:24:42 -04:00
parent 2e30b83545
commit 6a19ed2903
3 changed files with 26 additions and 19 deletions

View File

@ -1836,9 +1836,12 @@ def setting_authentication_api():
result = {'status': 1, 'messages': [], 'data': {}}
if request.form.get('commit') == '1':
result['messages'].append('Saved successfully.')
else:
result['messages'].append('Loaded successfully.')
model = Setting()
data = json.loads(request.form.get('data'))
for key, value in data.items():
if key in model.groups['authentication']:
model.set(key, value)
result['data'] = Setting().get_group('authentication')