plugin misc_account: fix for sending a failure message
This commit is contained in:
parent
9378880e62
commit
c584a689aa
1 changed files with 3 additions and 2 deletions
|
|
@ -22,6 +22,7 @@ from sat.core import exceptions
|
|||
from twisted.internet import reactor, defer, protocol
|
||||
from os.path import join, dirname
|
||||
from twisted.python.procutils import which
|
||||
from twisted.python.failure import Failure
|
||||
from email.mime.text import MIMEText
|
||||
from twisted.mail.smtp import sendmail
|
||||
|
||||
|
|
@ -73,7 +74,7 @@ class ProsodyRegisterProtocol(protocol.ProcessProtocol):
|
|||
self.deferred.callback(None)
|
||||
else:
|
||||
error(_(u"Can't register Prosody account (error code: %(code)d): %(message)s") % {'code': reason.value.exitCode, 'message': self.data})
|
||||
self.deferred.errback("INTERNAL")
|
||||
self.deferred.errback(Failure(u"INTERNAL"))
|
||||
|
||||
|
||||
class MiscAccount(object):
|
||||
|
|
@ -108,7 +109,7 @@ class MiscAccount(object):
|
|||
raise exceptions.DataError
|
||||
|
||||
if profile.lower() in RESERVED:
|
||||
return defer.fail('CONFLICT')
|
||||
return defer.fail(Failure(u'CONFLICT'))
|
||||
|
||||
d = self.host.memory.asyncCreateProfile(profile)
|
||||
d.addCallback(self._profileRegistered, email, password, profile)
|
||||
|
|
|
|||
Loading…
Reference in a new issue