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):
amount = yield from self.app.current_account.amount(self.community)
localized_amount = yield from self.app.current_account.current_ref(amount,
self.community, self.app).localized(units=True)
localized_monetary_mass = yield from self.app.current_account.current_ref(current_block['monetaryMass'],
if current_block['monetaryMass']:
localized_monetary_mass = yield from self.app.current_account.current_ref(current_block['monetaryMass'],
self.community, self.app).localized(units=True)
else:
localized_monetary_mass = ""
status = self.tr("Member") if self.app.current_account.pubkey in members_pubkeys \
else self.tr("Non-Member")
description = """<html>
......
......@@ -177,22 +177,23 @@ class IdentitiesTabWidget(QWidget, Ui_IdentitiesTab):
@asyncify
@asyncio.coroutine
def _async_search_members(self):
def _async_search_members(self, checked=False):
"""
Search members of community and display found members
"""
if self.community:
pubkeys = self.community.members_pubkeys()
pubkeys = yield from self.community.members_pubkeys()
identities = []
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.refresh_identities(identities)
@asyncify
@asyncio.coroutine
def _async_search_direct_connections(self):
def _async_search_direct_connections(self, checked=False):
"""
Search members of community and display found members
"""
......
......@@ -127,8 +127,8 @@ class IdentitiesTableModel(QAbstractTableModel):
:param cutecoin.core.registry.IdentitiesRegistry identities: The new identities to display
"""
logging.debug("Refresh {0} identities".format(len(identities)))
self.identities_data = []
self.beginResetModel()
self.identities_data = []
for identity in identities:
data = yield from self.identity_data(identity)
self.identities_data.append(data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment