Mercurial > libervia-backend
comparison sat_frontends/quick_frontend/quick_app.py @ 3017:e7cbe662838b
quick frontend (app): show an info log if avatar is not found instead of raising exception
fix 288
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 20 Jul 2019 16:03:28 +0200 |
parents | ba9aaf7d6cd0 |
children | ab2696e34d29 |
comparison
equal
deleted
inserted
replaced
3016:0b1c17c24bba | 3017:e7cbe662838b |
---|---|
1344 def _avatarGetCb(self, avatar_path, entity, contact_list, profile): | 1344 def _avatarGetCb(self, avatar_path, entity, contact_list, profile): |
1345 path = avatar_path or self.getDefaultAvatar(entity) | 1345 path = avatar_path or self.getDefaultAvatar(entity) |
1346 contact_list.setCache(entity, "avatar", path) | 1346 contact_list.setCache(entity, "avatar", path) |
1347 self.callListeners("avatar", entity, path, profile=profile) | 1347 self.callListeners("avatar", entity, path, profile=profile) |
1348 | 1348 |
1349 def _avatarGetEb(self, failure, entity, contact_list): | 1349 def _avatarGetEb(self, failure_, entity, contact_list): |
1350 log.warning(u"Can't get avatar: {}".format(failure)) | 1350 # FIXME: bridge needs a proper error handling |
1351 if "NotFound" in unicode(failure_): | |
1352 log.info(u"No avatar found for {entity}".format(entity=entity)) | |
1353 else: | |
1354 log.warning(u"Can't get avatar: {}".format(failure_)) | |
1351 contact_list.setCache(entity, "avatar", self.getDefaultAvatar(entity)) | 1355 contact_list.setCache(entity, "avatar", self.getDefaultAvatar(entity)) |
1352 | 1356 |
1353 def getAvatar( | 1357 def getAvatar( |
1354 self, | 1358 self, |
1355 entity, | 1359 entity, |