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:
parent
ed9df2984d
commit
a6897c76e0
1 changed files with 25 additions and 140 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue