From abb9c05b6c484dd9b17472d37ce2f5906778bca0 Mon Sep 17 00:00:00 2001 From: Dariusz Kedzierski <dkedzierski@syncad.com> Date: Tue, 5 May 2020 19:54:38 +0200 Subject: [PATCH] Fix: all types other than str will be trated as invalid account name string --- hive/indexer/accounts.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/hive/indexer/accounts.py b/hive/indexer/accounts.py index 2343bf907..a9673acbb 100644 --- a/hive/indexer/accounts.py +++ b/hive/indexer/accounts.py @@ -58,19 +58,15 @@ class Accounts: @classmethod def get_id(cls, name): """Get account id by name. Throw if not found.""" - if isinstance(name, list): - assert name[0] in cls._ids, "account does not exist or was not registered" - return cls._ids[name[0]] assert name in cls._ids, "account does not exist or was not registered" return cls._ids[name] @classmethod def exists(cls, name): """Check if an account name exists.""" - if isinstance(name, list): - return name[0] in cls._ids - return name in cls._ids - + if isinstance(name, str): + return name in cls._ids + return False @classmethod def register(cls, names, block_date): -- GitLab