diff src/plugins/plugin_misc_groupblog.py @ 941:c6d8fc63b1db

core, plugins: host.getClient now raise an exception instead of returning None when no profile is found, plugins have been adapted consequently and a bit cleaned
author Goffi <goffi@goffi.org>
date Fri, 28 Mar 2014 18:07:02 +0100
parents fc7e0828b18e
children e1842ebcb2f3
line wrap: on
line diff
--- a/src/plugins/plugin_misc_groupblog.py	Fri Mar 28 18:06:51 2014 +0100
+++ b/src/plugins/plugin_misc_groupblog.py	Fri Mar 28 18:07:02 2014 +0100
@@ -154,9 +154,6 @@
             raise exceptions.ProfileUnknownError
 
         client = self.host.getClient(profile)
-        if not client:
-            error(_('No client for this profile key: %s') % profile_key)
-            raise Exception("Unknown profile")
         yield client.client_initialized  # we want to be sure that the client is initialized
 
         #we first check that we have a item-access pubsub server
@@ -309,7 +306,7 @@
             # FIXME: check comments node creation success, at the moment this is a potential security risk (if the node
             #        already exists, the creation will silently fail, but the comments link will stay the same, linking to a
             #        node owned by somebody else)
-            defer_blog = self.host.plugins["XEP-0060"].createNode(service, comments_node, _options, profile_key=client.profile)
+            self.host.plugins["XEP-0060"].createNode(service, comments_node, _options, profile_key=client.profile)
 
         def itemCreated(mblog_item):
             form = data_form.Form('submit', formNamespace=NS_PUBSUB_ITEM_CONFIG)