changeset 36:a67d9617b4ef

tmp (wokkel/pubsub): fixed configuration setting
author Goffi <goffi@goffi.org>
date Thu, 23 Mar 2017 09:07:10 +0100
parents 79e36496994a
children e8296d7bfeb1
files wokkel/pubsub.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/wokkel/pubsub.py	Tue Mar 14 00:18:02 2017 +0100
+++ b/wokkel/pubsub.py	Thu Mar 23 09:07:10 2017 +0100
@@ -471,7 +471,7 @@
         Parse optional node configuration form in create request.
         """
         for element in verbElement.parent.elements():
-            if element.uri == NS_PUBSUB and element.name == 'configure':
+            if element.uri == NS_PUBSUB_OWNER and element.name == 'configure':
                 form = data_form.findForm(element, NS_PUBSUB_NODE_CONFIG)
                 if form is not None:
                     if form.formType != 'submit':
@@ -488,7 +488,10 @@
         Render optional node configuration form in create request.
         """
         if self.options is not None:
-            configure = verbElement.parent.addElement('configure')
+            if verbElement.name == 'configure':
+                configure = verbElement
+            else:
+                configure = verbElement.parent.addElement('configure')
             configure.addChild(self.options.toElement())
 
 
@@ -1266,7 +1269,6 @@
 
     def _onPubSubRequest(self, iq):
         request = self._request_class.fromElement(iq)
-
         if self.resource is not None:
             resource = self.resource.locateResource(request)
         else: