Skip to content
Snippets Groups Projects
Commit 8a91aad6 authored by inso's avatar inso
Browse files

Fix crashes in identities_tab

parent 5a917c79
No related branches found
No related tags found
No related merge requests found
...@@ -35,8 +35,11 @@ class CommunityTile(QFrame): ...@@ -35,8 +35,11 @@ class CommunityTile(QFrame):
amount = yield from self.app.current_account.amount(self.community) amount = yield from self.app.current_account.amount(self.community)
localized_amount = yield from self.app.current_account.current_ref(amount, localized_amount = yield from self.app.current_account.current_ref(amount,
self.community, self.app).localized(units=True) self.community, self.app).localized(units=True)
if current_block['monetaryMass']:
localized_monetary_mass = yield from self.app.current_account.current_ref(current_block['monetaryMass'], localized_monetary_mass = yield from self.app.current_account.current_ref(current_block['monetaryMass'],
self.community, self.app).localized(units=True) self.community, self.app).localized(units=True)
else:
localized_monetary_mass = ""
status = self.tr("Member") if self.app.current_account.pubkey in members_pubkeys \ status = self.tr("Member") if self.app.current_account.pubkey in members_pubkeys \
else self.tr("Non-Member") else self.tr("Non-Member")
description = """<html> description = """<html>
......
...@@ -177,22 +177,23 @@ class IdentitiesTabWidget(QWidget, Ui_IdentitiesTab): ...@@ -177,22 +177,23 @@ class IdentitiesTabWidget(QWidget, Ui_IdentitiesTab):
@asyncify @asyncify
@asyncio.coroutine @asyncio.coroutine
def _async_search_members(self): def _async_search_members(self, checked=False):
""" """
Search members of community and display found members Search members of community and display found members
""" """
if self.community: if self.community:
pubkeys = self.community.members_pubkeys() pubkeys = yield from self.community.members_pubkeys()
identities = [] identities = []
for p in pubkeys: for p in pubkeys:
identities.append(self.app.identities_registry.find(p, self.community)) identity = yield from self.app.identities_registry.future_find(p, self.community)
identities.append(identity)
self.edit_textsearch.clear() self.edit_textsearch.clear()
self.refresh_identities(identities) self.refresh_identities(identities)
@asyncify @asyncify
@asyncio.coroutine @asyncio.coroutine
def _async_search_direct_connections(self): def _async_search_direct_connections(self, checked=False):
""" """
Search members of community and display found members Search members of community and display found members
""" """
......
...@@ -127,8 +127,8 @@ class IdentitiesTableModel(QAbstractTableModel): ...@@ -127,8 +127,8 @@ class IdentitiesTableModel(QAbstractTableModel):
:param cutecoin.core.registry.IdentitiesRegistry identities: The new identities to display :param cutecoin.core.registry.IdentitiesRegistry identities: The new identities to display
""" """
logging.debug("Refresh {0} identities".format(len(identities))) logging.debug("Refresh {0} identities".format(len(identities)))
self.identities_data = []
self.beginResetModel() self.beginResetModel()
self.identities_data = []
for identity in identities: for identity in identities:
data = yield from self.identity_data(identity) data = yield from self.identity_data(identity)
self.identities_data.append(data) self.identities_data.append(data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment