[ldaputils] should use entity.eid instead of entity on raising ValidationError. closes #2517095 stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 08 Nov 2012 11:40:24 +0100
branchstable
changeset 8586 bc74608d2003
parent 8585 3f60f416dddb
child 8587 bde0501e0251
[ldaputils] should use entity.eid instead of entity on raising ValidationError. closes #2517095
server/ldaputils.py
--- a/server/ldaputils.py	Wed Nov 14 11:06:24 2012 +0100
+++ b/server/ldaputils.py	Thu Nov 08 11:40:24 2012 +0100
@@ -137,13 +137,13 @@
     def _entity_update(self, source_entity):
         if self.urls:
             if len(self.urls) > 1:
-                raise ValidationError(source_entity, {'url': _('can only have one url')})
+                raise ValidationError(source_entity.eid, {'url': _('can only have one url')})
             try:
                 protocol, hostport = self.urls[0].split('://')
             except ValueError:
-                raise ValidationError(source_entity, {'url': _('badly formatted url')})
+                raise ValidationError(source_entity.eid, {'url': _('badly formatted url')})
             if protocol not in PROTO_PORT:
-                raise ValidationError(source_entity, {'url': _('unsupported protocol')})
+                raise ValidationError(source_entity.eid, {'url': _('unsupported protocol')})
 
     def update_config(self, source_entity, typedconfig):
         """update configuration from source entity. `typedconfig` is config