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

This commit is contained in:
Goffi 2014-03-28 18:07:02 +01:00
commit a6897c76e0

View file

@ -154,9 +154,6 @@ class GroupBlog(object):
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 @@ class GroupBlog(object):
# 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)