Make sure msg(text=None) means that text should not be used (None must be converted to a string to send). Resolves #1077.

This commit is contained in:
Griatch 2016-10-02 21:51:15 +02:00
parent 2b35140fe3
commit 00c64b10bb
2 changed files with 5 additions and 1 deletions

View file

@ -71,7 +71,7 @@ class ContentsHandler(object):
pks = self._pkcache
try:
return [self._idcache[pk] for pk in pks]
except KeyError, err:
except KeyError:
# this can happen if the idmapper cache was cleared for an object
# in the contents cache. If so we need to re-initialize and try again.
self.init()

View file

@ -188,6 +188,10 @@ class SessionHandler(dict):
for key, data in kwargs.iteritems():
key = _validate(key)
if not data:
if key == "text":
# we don't allow sending text = None, this must mean
# that the text command is not to be used.
continue
rkwargs[key] = [ [], {} ]
elif isinstance(data, dict):
rkwargs[key] = [ [], _validate(data) ]