Fix layout saving which didn't work after jQuery changes. #5701

This commit is contained in:
Aditya Toshniwal 2023-03-15 18:57:31 +05:30 committed by GitHub
parent 89c8a7f907
commit 7b18ce10fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,13 +104,15 @@ def store(setting=None, value=None):
errormsg = ''
try:
data = request.form if request.form else json.loads(
request.data.decode('utf-8'))
if request.method == 'POST':
if 'count' in request.form:
for x in range(int(request.form['count'])):
store_setting(request.form['setting%d' % (
x + 1)], request.form['value%d' % (x + 1)])
for x in range(int(data['count'])):
store_setting(data['setting%d' % (
x + 1)], data['value%d' % (x + 1)])
else:
store_setting(request.form['setting'], request.form['value'])
store_setting(data['setting'], data['value'])
else:
store_setting(setting, value)
except Exception as e: