changeset 2473:447c3de6b9e5

plugin merge-requests: fixed "set" method
author Goffi <goffi@goffi.org>
date Sat, 13 Jan 2018 10:12:15 +0100
parents 3f0a3a0ed290
children e04c874ace79
files src/plugins/plugin_misc_merge_requests.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_misc_merge_requests.py	Sat Jan 13 10:03:32 2018 +0100
+++ b/src/plugins/plugin_misc_merge_requests.py	Sat Jan 13 10:12:15 2018 +0100
@@ -33,7 +33,7 @@
     C.PI_IMPORT_NAME: "MERGE_REQUESTS",
     C.PI_TYPE: "EXP",
     C.PI_PROTOCOLS: [],
-    C.PI_DEPENDENCIES: ["XEP-0060", "PUBSUB_SCHEMA"],
+    C.PI_DEPENDENCIES: ["XEP-0060", "PUBSUB_SCHEMA", "TICKETS"],
     C.PI_MAIN: "MergeRequests",
     C.PI_HANDLER: "no",
     C.PI_DESCRIPTION: _("""Merge requests management plugin""")
@@ -68,6 +68,7 @@
         host.registerNamespace('merge_requests', NS_MERGE_REQUESTS)
         self._p = self.host.plugins["XEP-0060"]
         self._s = self.host.plugins["PUBSUB_SCHEMA"]
+        self._t = self.host.plugins["TICKETS"]
         self._handlers = {}
         self._handlers_list = []  # handlers sorted by priority
         self._type_handlers = {}  # data type => handler map
@@ -185,6 +186,8 @@
         other arguments are same as for [TICKETS.set]
         @return (unicode): id of the created item
         """
+        if not node:
+            node = NS_MERGE_REQUESTS
         if values is None:
             values = {}
 
@@ -224,7 +227,7 @@
 
         values[FIELD_DATA] = data
 
-        item_id = yield self._t.set(client, service, node, values, schema, item_id, extra, deserialise, default_node=NS_MERGE_REQUESTS, form_ns=NS_MERGE_REQUESTS)
+        item_id = yield self._t.set(client, service, node, values, schema, item_id, extra, deserialise, form_ns=NS_MERGE_REQUESTS)
         defer.returnValue(item_id)
 
     def _parseData(self, data_type, data):