mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
only validate form fileds if the form is enabled at all
This commit is contained in:
parent
9f8281f9dc
commit
1a3d7a3d00
@ -174,16 +174,17 @@ class ConfigureForm(forms.Form):
|
|||||||
else:
|
else:
|
||||||
dynamicdns_server = ""
|
dynamicdns_server = ""
|
||||||
|
|
||||||
"""check if gnudip server or update URL is filled"""
|
if cleaned_data.get('enabled'):
|
||||||
if not dynamicdns_update_url and not dynamicdns_server:
|
"""check if gnudip server or update URL is filled"""
|
||||||
raise forms.ValidationError('please give update URL or \
|
if not dynamicdns_update_url and not dynamicdns_server:
|
||||||
a GnuDIP Server')
|
raise forms.ValidationError('please give update URL or \
|
||||||
LOGGER.info('no server address given')
|
a GnuDIP Server')
|
||||||
|
LOGGER.info('no server address given')
|
||||||
|
|
||||||
"""check if a password was set before or a password is set now"""
|
"""check if a password was set before or a password is set now"""
|
||||||
if not dynamicdns_secret and not old_dynamicdns_secret:
|
if not dynamicdns_secret and not old_dynamicdns_secret:
|
||||||
raise forms.ValidationError('please give a password')
|
raise forms.ValidationError('please give a password')
|
||||||
LOGGER.info('no password given')
|
LOGGER.info('no password given')
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user