From a9634b9aea64eb4e00c497e72814f6bd9c237556 Mon Sep 17 00:00:00 2001 From: Blake DeMarcy Date: Fri, 3 Mar 2017 00:15:13 -0600 Subject: [PATCH] mapname -> namemap --- src/db.py | 8 ++++---- src/endpoints.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/db.py b/src/db.py index e47ecf5..c7f2e46 100644 --- a/src/db.py +++ b/src/db.py @@ -18,7 +18,7 @@ try: USERDB = json.loads(f.read()) except FileNotFoundError: - USERDB = dict(mapname=dict()) + USERDB = dict(namemap=dict()) with open(path.join(PATH, "userdb"), "w") as f: f.write(json.dumps(USERDB)) path.os.chmod(path.join(PATH, "userdb"), 0o600) @@ -95,19 +95,19 @@ def user_resolve(name_or_id): if check: return name_or_id else: - return USERDB["mapname"][name_or_id] + return USERDB["namemap"][name_or_id] except KeyError: return False def user_register(auth_hash, name, quip, bio): - if USERDB["mapname"].get(name): + if USERDB["namemap"].get(name): return schema.error(4, "Username taken.") ID = uuid1().hex scheme = schema.user_internal(ID, auth_hash, name, quip, bio, False) USERDB.update({ID: scheme}) - USERDB["mapname"].update({name: ID}) + USERDB["namemap"].update({name: ID}) user_dbdump(USERDB) return scheme diff --git a/src/endpoints.py b/src/endpoints.py index 2027128..3042627 100644 --- a/src/endpoints.py +++ b/src/endpoints.py @@ -32,7 +32,7 @@ def create_usermap(thread, index=False): def is_registered(json): - return bool(db.USERDB["mapname"].get(json["target_user"])) + return bool(db.USERDB["namemap"].get(json["target_user"])) def check_auth(json):