server/ldaputils.py
changeset 8596 bd4f5052a532
parent 8586 bc74608d2003
child 8638 9f95c2368b8b
equal deleted inserted replaced
8595:01e1e44f1eb3 8596:bd4f5052a532
   135     _conn = None
   135     _conn = None
   136 
   136 
   137     def _entity_update(self, source_entity):
   137     def _entity_update(self, source_entity):
   138         if self.urls:
   138         if self.urls:
   139             if len(self.urls) > 1:
   139             if len(self.urls) > 1:
   140                 raise ValidationError(source_entity, {'url': _('can only have one url')})
   140                 raise ValidationError(source_entity.eid, {'url': _('can only have one url')})
   141             try:
   141             try:
   142                 protocol, hostport = self.urls[0].split('://')
   142                 protocol, hostport = self.urls[0].split('://')
   143             except ValueError:
   143             except ValueError:
   144                 raise ValidationError(source_entity, {'url': _('badly formatted url')})
   144                 raise ValidationError(source_entity.eid, {'url': _('badly formatted url')})
   145             if protocol not in PROTO_PORT:
   145             if protocol not in PROTO_PORT:
   146                 raise ValidationError(source_entity, {'url': _('unsupported protocol')})
   146                 raise ValidationError(source_entity.eid, {'url': _('unsupported protocol')})
   147 
   147 
   148     def update_config(self, source_entity, typedconfig):
   148     def update_config(self, source_entity, typedconfig):
   149         """update configuration from source entity. `typedconfig` is config
   149         """update configuration from source entity. `typedconfig` is config
   150         properly typed with defaults set
   150         properly typed with defaults set
   151         """
   151         """