quick frontend (contact list): fixed cached key removal

This commit is contained in:
Goffi 2017-01-15 16:00:40 +01:00
commit 450c9c0a15

View file

@ -395,7 +395,11 @@ class ProfileContactList(object):
cache_attr = cache[C.CONTACT_RESOURCES].setdefault(entity.resource, {}) if entity.resource else cache
for attribute, value in attributes.iteritems():
if value is None:
cache_attr[attribute].pop(value, None)
# XXX: pyjamas hack: we need to use pop instead of del
try:
cache_attr[attribute].pop(value)
except KeyError:
pass
else:
cache_attr[attribute] = value