Skip to content
Snippets Groups Projects
Commit ffd4b027 authored by Gandalf's avatar Gandalf
Browse files

Update accounts.py

parent 0c851a07
No related branches found
No related tags found
1 merge request!11Update accounts.py
......@@ -58,14 +58,20 @@ 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
@classmethod
def register(cls, names, block_date):
"""Block processing: register "candidate" names.
......
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