diff --git a/lib/ucoinpy/documents/block.py b/lib/ucoinpy/documents/block.py index 873f404d09bc74de170d779aa1145ac6968863f1..6a023cd6f383908cb087ea57a2abf593e97ea10a 100644 --- a/lib/ucoinpy/documents/block.py +++ b/lib/ucoinpy/documents/block.py @@ -73,6 +73,7 @@ BOTTOM_SIGNATURE re_actives = re.compile("Actives:\n") re_leavers = re.compile("Leavers:\n") re_excluded = re.compile("Excluded:\n") + re_exclusion = re.compile("([1-9A-Za-z][^OIl]{42,45})\n") re_certifications = re.compile("Certifications:\n") re_transactions = re.compile("Transactions:\n") @@ -197,7 +198,7 @@ BOTTOM_SIGNATURE if Block.re_excluded.match(lines[n]): n = n + 1 while Block.re_certifications.match(lines[n]) is None: - membership = Membership.from_inline(version, currency, "OUT", lines[n]) + membership = Block.re_exclusion.match(lines[n]).group(1) excluded.append(membership) n = n + 1 @@ -282,7 +283,7 @@ PreviousIssuer: {1}\n".format(self.prev_hash, self.prev_issuer) doc += "Excluded:\n" for exclude in self.excluded: - doc += "{0}\n".format(exclude.inline()) + doc += "{0}\n".format(exclude) doc += "Certifications:\n" for cert in self.certifications: diff --git a/src/cutecoin/core/person.py b/src/cutecoin/core/person.py index 0ebc8fc58ae5ec0c714d1c186427ea34fceaa42f..60b24176947bdb280c3be3dd0243decf0e8d8954 100644 --- a/src/cutecoin/core/person.py +++ b/src/cutecoin/core/person.py @@ -32,6 +32,7 @@ class Person(object): ''' data = community.request(bma.wot.Lookup, req_args={'search': pubkey}) results = data['results'] + logging.debug(results) timestamp = 0 for result in data['results']: diff --git a/src/cutecoin/gui/community_tab.py b/src/cutecoin/gui/community_tab.py index 4165abd337ffc6f4951eb203e21c5e228ebc2d02..c7c7938786d727fc1ed6f66c11f60ee50cd4eafb 100644 --- a/src/cutecoin/gui/community_tab.py +++ b/src/cutecoin/gui/community_tab.py @@ -14,6 +14,7 @@ from .add_contact import AddContactDialog from .wot_tab import WotTabWidget from .transfer import TransferMoneyDialog from .certification import CertificationDialog +from ..tools.exceptions import PersonNotFoundError class CommunityTabWidget(QWidget, Ui_CommunityTabWidget): @@ -32,6 +33,7 @@ class CommunityTabWidget(QWidget, Ui_CommunityTabWidget): self.account = account self.password_asker = password_asker self.list_community_members.setModel(MembersListModel(community)) + self.button_membership.disconnect() if self.account.member_of(self.community): self.button_membership.setText("Send leaving demand") @@ -111,6 +113,10 @@ class CommunityTabWidget(QWidget, Ui_CommunityTabWidget): except ValueError as e: QMessageBox.critical(self, "Join demand error", e.message) + except PersonNotFoundError as e: + QMessageBox.critical(self, "Key not sent to community", + "Your key wasn't sent in the community. \ + You can't request a membership.") def send_membership_leaving(self): password = ""