Merge pull request #3606 from cchurch/fix-ldap-saml-defaults

Fix default value validation for LDAP/SAML settings to prevent warnings.
This commit is contained in:
Chris Church
2016-09-28 11:11:46 -04:00
committed by GitHub
3 changed files with 13 additions and 1 deletions

View File

@@ -34,6 +34,11 @@ class URLField(CharField):
validator_kwargs['schemes'] = schemes
self.validators.append(URLValidator(**validator_kwargs))
def to_representation(self, value):
if value is None:
return ''
return super(URLField, self).to_representation(value)
def run_validators(self, value):
if self.allow_plain_hostname:
try: