server/ldaputils.py
branchstable
changeset 8586 bc74608d2003
parent 8473 2646a8e99b0d
child 8638 9f95c2368b8b
equal deleted inserted replaced
8585:3f60f416dddb 8586:bc74608d2003
   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         """