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

Fix error when sending membership

parent ea997595
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
......@@ -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']:
......
......@@ -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 = ""
......
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