mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
do not clear server and URL values when changing dropdown menu but check if one of them is filled when validate the form
This commit is contained in:
parent
3b0a070283
commit
21c4326a1d
@ -165,8 +165,14 @@ class ConfigureForm(forms.Form):
|
||||
dynamicdns_secret = cleaned_data.get('dynamicdns_secret')
|
||||
dynamicdns_update_url = cleaned_data.get('dynamicdns_update_url')
|
||||
dynamicdns_server = cleaned_data.get('dynamicdns_server')
|
||||
service_type = cleaned_data.get('service_type')
|
||||
old_dynamicdns_secret = self.initial['dynamicdns_secret']
|
||||
|
||||
if service_type == '1':
|
||||
dynamicdns_update_url = ""
|
||||
else:
|
||||
dynamicdns_server = ""
|
||||
|
||||
"""Todo: this is not working!! will see tomorrow why"""
|
||||
if not dynamicdns_update_url and not dynamicdns_server:
|
||||
raise forms.ValidationError('please give update URL or \
|
||||
@ -319,11 +325,6 @@ def _apply_changes(request, old_status, new_status):
|
||||
if new_status['dynamicdns_server'] == '':
|
||||
new_status['dynamicdns_server'] = EMPTYSTRING
|
||||
|
||||
if new_status['service_type'] == '1':
|
||||
new_status['dynamicdns_ipurl'] = EMPTYSTRING
|
||||
else:
|
||||
new_status['dynamicdns_server'] = EMPTYSTRING
|
||||
|
||||
if old_status != new_status:
|
||||
disable_ssl_check = "disabled"
|
||||
use_http_basic_auth = "disabled"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user