need to remove unused parameters according to dropdown box selection

This commit is contained in:
Daniel Steglich 2015-03-06 23:27:45 +01:00
parent 21c4326a1d
commit ce057ebd22

View File

@ -173,7 +173,6 @@ class ConfigureForm(forms.Form):
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 \
a GnuDIP Server')
@ -325,6 +324,11 @@ 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_update_url'] = EMPTYSTRING
else:
new_status['dynamicdns_server'] = EMPTYSTRING
if old_status != new_status:
disable_ssl_check = "disabled"
use_http_basic_auth = "disabled"