Mercurial > libervia-pubsub
comparison 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 |
comparison
equal
deleted
inserted
replaced
360:6350622d9eb9 | 361:a92f482ff14f |
---|---|
83 except KeyError: | 83 except KeyError: |
84 raise pubsub.BadRequest(text='missing node') | 84 raise pubsub.BadRequest(text='missing node') |
85 requestor = jid.JID(iq_elt['from']) | 85 requestor = jid.JID(iq_elt['from']) |
86 pep = iq_elt.delegated | 86 pep = iq_elt.delegated |
87 recipient = jid.JID(iq_elt['to']) | 87 recipient = jid.JID(iq_elt['to']) |
88 for x_elt in schema_elt.elements(data_form.NS_X_DATA, u'x'): | 88 try: |
89 schema_form = data_form.Form.fromElement(x_elt) | 89 x_elt = next(schema_elt.elements(data_form.NS_X_DATA, u'x')) |
90 if schema_form.formNamespace == const.NS_SCHEMA_FORM: | 90 except StopIteration: |
91 break | |
92 else: | |
93 # no schema form has been found | 91 # no schema form has been found |
94 x_elt = None | 92 x_elt = None |
95 d = self.backend.setNodeSchema(nodeIdentifier, | 93 d = self.backend.setNodeSchema(nodeIdentifier, |
96 x_elt, | 94 x_elt, |
97 requestor, | 95 requestor, |