From d83d020f55972856b29d49deace7dee78e6d7389 Mon Sep 17 00:00:00 2001
From: Inso <insomniak.fr@gmail.com>
Date: Sun, 26 Apr 2015 02:26:27 +0200
Subject: [PATCH] Fixed bug in add_contact actions

---
 src/cutecoin/gui/community_tab.py | 3 ++-
 src/cutecoin/gui/wot_tab.py       | 7 ++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/cutecoin/gui/community_tab.py b/src/cutecoin/gui/community_tab.py
index d138e580..354142f0 100644
--- a/src/cutecoin/gui/community_tab.py
+++ b/src/cutecoin/gui/community_tab.py
@@ -100,7 +100,8 @@ class CommunityTabWidget(QWidget, Ui_CommunityTabWidget):
 
     def menu_add_as_contact(self):
         person = self.sender().data()
-        self.add_member_as_contact(person)
+        self.add_member_as_contact({'name': person.uid,
+                                    'pubkey': person.pubkey})
 
     def menu_send_money(self):
         person = self.sender().data()
diff --git a/src/cutecoin/gui/wot_tab.py b/src/cutecoin/gui/wot_tab.py
index 98165b6c..f08eefb3 100644
--- a/src/cutecoin/gui/wot_tab.py
+++ b/src/cutecoin/gui/wot_tab.py
@@ -166,10 +166,11 @@ class WotTabWidget(QWidget, Ui_WotTabWidget):
 
     def add_node_as_contact(self, metadata):
         # check if contact already exists...
-        if metadata['id'] == self.account.pubkey or metadata['id'] in [contact.pubkey for contact in self.account.contacts]:
+        if metadata['id'] == self.account.pubkey \
+            or metadata['id'] in [contact['pubkey'] for contact in self.account.contacts]:
             return False
-        person = Person.from_metadata(metadata)
-        self.parent.add_member_as_contact(person)
+        self.parent.add_member_as_contact({'name': metadata['text'],
+                                           'pubkey': metadata['id']})
 
     def get_block_mediantime(self, number):
         try:
-- 
GitLab