core: boolConst is used to convert a boolean value to its equivalent string constant

This commit is contained in:
Goffi 2015-02-09 21:39:47 +01:00
commit 5049bc0b47

View file

@ -48,7 +48,7 @@ class ProfileManager(object):
def gotProfileCipher(profile_cipher):
if self.host.memory.auth_sessions.profileGetUnique(profile):
# case 1: profile already authenticated
return {'validated': C.str(True)}
return {'validated': C.boolConst(True)}
self.profile_ciphers[profile] = profile_cipher
if 'profile_password' in data:
# case 2: password is provided by the caller
@ -81,7 +81,7 @@ class ProfileManager(object):
def getParamError(self, failure):
_dialog = xml_tools.XMLUI('popup', title=D_('Error'))
_dialog.addText(D_("Can't get profile parameter."))
return {'xmlui': _dialog.toXml(), 'validated': C.str(False)}
return {'xmlui': _dialog.toXml(), 'validated': C.boolConst(False)}
@defer.inlineCallbacks
def _verifyPassword(self, data, profile):
@ -101,10 +101,10 @@ class ProfileManager(object):
if not verified:
_dialog = xml_tools.XMLUI('popup', title=D_('Connection error'))
_dialog.addText(D_("The provided profile password doesn't match."))
defer.returnValue({'xmlui': _dialog.toXml(), 'validated': C.str(False)})
defer.returnValue({'xmlui': _dialog.toXml(), 'validated': C.boolConst(False)})
yield self.host.memory.newAuthSession(profile_password, profile)
defer.returnValue({'validated': C.str(True)})
defer.returnValue({'validated': C.boolConst(True)})
def _changeXMPPPassword(self, data, profile):
session_data = self._sessions.profileGetUnique(profile)