Mercurial > libervia-pubsub
diff sat_pubsub/schema.py @ 361:a92f482ff14f
schema: allow free FORM_TYPE as this is used for items validation, and should not be in schema namespace
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 27 Oct 2017 18:27:18 +0200 |
parents | efbdca10f0fb |
children |
line wrap: on
line diff
--- a/sat_pubsub/schema.py Fri Oct 13 20:57:47 2017 +0200 +++ b/sat_pubsub/schema.py Fri Oct 27 18:27:18 2017 +0200 @@ -85,11 +85,9 @@ requestor = jid.JID(iq_elt['from']) pep = iq_elt.delegated recipient = jid.JID(iq_elt['to']) - for x_elt in schema_elt.elements(data_form.NS_X_DATA, u'x'): - schema_form = data_form.Form.fromElement(x_elt) - if schema_form.formNamespace == const.NS_SCHEMA_FORM: - break - else: + try: + x_elt = next(schema_elt.elements(data_form.NS_X_DATA, u'x')) + except StopIteration: # no schema form has been found x_elt = None d = self.backend.setNodeSchema(nodeIdentifier,