# HG changeset patch # User Goffi # Date 1509121638 -7200 # Node ID a92f482ff14f45f4e6f31736053cb20e83d843a1 # Parent 6350622d9eb9fb322ca7bacf93b0d1b29a9f9988 schema: allow free FORM_TYPE as this is used for items validation, and should not be in schema namespace diff -r 6350622d9eb9 -r a92f482ff14f sat_pubsub/const.py --- a/sat_pubsub/const.py Fri Oct 13 20:57:47 2017 +0200 +++ b/sat_pubsub/const.py Fri Oct 27 18:27:18 2017 +0200 @@ -57,7 +57,6 @@ NS_ATOM = "http://www.w3.org/2005/Atom" NS_FORWARD = 'urn:xmpp:forward:0' NS_SCHEMA = 'https://salut-a-toi/protocol/schema:0' -NS_SCHEMA_FORM = 'https://salut-a-toi/protocol/schema#schema:0' NS_SCHEMA_RESTRICT = 'https://salut-a-toi/protocol/schema#restrict:0' OPT_ACCESS_MODEL = 'pubsub#access_model' diff -r 6350622d9eb9 -r a92f482ff14f sat_pubsub/schema.py --- 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,