core: misc bug fixes

This commit is contained in:
Goffi 2013-09-21 15:34:10 +02:00
commit 92d861f334

View file

@ -25,6 +25,7 @@ from xml.dom import minidom
from logging import debug, info, warning, error
from twisted.internet import defer
from twisted.words.protocols.jabber import jid
from twisted.python.failure import Failure
from sat.tools.xml_tools import paramsXml2xmlUI
from sat.core.default_config import default_config
from sat.memory.sqlite import SqliteStorage
@ -161,9 +162,9 @@ class Params(object):
"""
if self.storage.hasProfile(profile):
info(_('The profile name already exists'))
return defer.fail("CONFLICT")
return defer.fail(Failure(u"CONFLICT"))
if not self.host.trigger.point("ProfileCreation", profile):
return defer.fail("CANCEL")
return defer.fail(Failure(u"CANCEL"))
return self.storage.createProfile(profile)
def deleteProfile(self, profile):