From 58c19894a1fd0a801f3cdaa973244fe61cc5a759 Mon Sep 17 00:00:00 2001 From: Ivan Filippov Date: Sat, 2 Jul 2016 22:30:16 -0600 Subject: [PATCH] Convert value returned from UI to string before storing it in DB. This should allow for differences in how database engine store booleans. --- app/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views.py b/app/views.py index c240c96..a9cf778 100644 --- a/app/views.py +++ b/app/views.py @@ -456,7 +456,7 @@ def admin_setdomainsetting(domain_name): data = jdata['data'] if jdata['action'] == 'set_setting': new_setting = data['setting'] - new_value = data['value'] + new_value = str(data['value']) domain = Domain.query.filter(Domain.name == domain_name).first() setting = DomainSetting.query.filter(DomainSetting.domain == domain).filter(DomainSetting.setting == new_setting).first() @@ -755,7 +755,7 @@ def dyndns_update(): return render_template('dyndns.html', response='911'), 200 elif r.is_allowed: ondemand_creation = DomainSetting.query.filter(DomainSetting.domain == domain).filter(DomainSetting.setting == 'create_via_dyndns').first() - if bool(int(ondemand_creation.value)) == True: + if strtobool(ondemand_creation.value) == True: record = Record(name=hostname,type='A',data=myip,status=False,ttl=3600) result = record.add(domain.name) if result['status'] == 'ok':