From 6f1bf1ba1fd11f11400fc9fef1804e872deb60bd Mon Sep 17 00:00:00 2001 From: nolash Date: Sat, 6 Nov 2021 14:51:52 +0100 Subject: [PATCH] Proper classmethod parent invoke for account/person --- clicada/user/file.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/clicada/user/file.py b/clicada/user/file.py index 674e2a3..3090c4e 100644 --- a/clicada/user/file.py +++ b/clicada/user/file.py @@ -36,9 +36,9 @@ class Account(Person): logg.debug('tags are now {}'.format(self.tags)) - @staticmethod - def from_person_data(person_data): - o = Account.deserialize(person_data) + @classmethod + def deserialize(cls, person_data): + o = super(Account, cls).deserialize(person_data) try: o.tags = person_data['custom']['tags'] except KeyError as e: @@ -184,7 +184,6 @@ class FileUserStore: logg.info(e) pass - #getter = MetadataRequestsHandler(MetadataPointer.PHONE, phone.encode('utf-8')) r = None user_address = None try: @@ -210,7 +209,7 @@ class FileUserStore: v = json.loads(v) person = Account() try: - person_data = person.from_person_data(person_data=v) + person_data = person.deserialize(person_data=v) except Exception as e: logg.error('e {}'.format(e)) person_data = v @@ -234,7 +233,7 @@ class FileUserStore: data = json.loads(r) person = Account() - person_data = person.from_person_data(person_data=data) + person_data = person.deserialize(person_data=data) ptr = generate_metadata_pointer(bytes.fromhex(address), MetadataPointer.CUSTOM) r = None