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 """ |