Lines 589-594
def _sanitize(self, value, name, further_args):
|
Link Here
|
---|
|
589 |
return value |
589 |
return value |
590 |
|
590 |
|
591 |
|
591 |
|
|
|
592 |
class DNSanitizer(StringSanitizer): |
593 |
|
594 |
''' DNSanitizer is a sanitizer that checks if the value has correct LDAP |
595 |
Distinguished Name syntax ''' |
596 |
|
597 |
def _sanitize(self, value, name, further_args): |
598 |
value = super(DNSanitizer, self)._sanitize(value, name, further_args) |
599 |
try: |
600 |
ldap.dn.str2dn(value) |
601 |
except ldap.DECODING_ERROR: |
602 |
self.raise_validation_error(_('Value is not a LDAP DN.')) |
603 |
return value |
604 |
|
605 |
|
592 |
class EmailSanitizer(StringSanitizer): |
606 |
class EmailSanitizer(StringSanitizer): |
593 |
|
607 |
|
594 |
''' EmailSanitizer is a very simple sanitizer that checks |
608 |
''' EmailSanitizer is a very simple sanitizer that checks |