From d1c7180d5d374afe0ed1b427797d59075782fa21 Mon Sep 17 00:00:00 2001 From: nsde Date: Sat, 14 Oct 2023 01:23:25 +0200 Subject: [PATCH] Small fixes --- api/db/helpers.py | 12 ++++++++++++ api/db/users.py | 10 ---------- 2 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 api/db/helpers.py diff --git a/api/db/helpers.py b/api/db/helpers.py new file mode 100644 index 0000000..ea0319e --- /dev/null +++ b/api/db/helpers.py @@ -0,0 +1,12 @@ +import os + +def find_project_root(): + current_path = os.getcwd() + while not os.path.isfile(os.path.join(current_path, 'LICENSE')): + current_path = os.path.dirname(current_path) + return current_path + +root = find_project_root() + +if __name__ == '__main__': + print(find_project_root()) \ No newline at end of file diff --git a/api/db/users.py b/api/db/users.py index 6029ce2..691da68 100644 --- a/api/db/users.py +++ b/api/db/users.py @@ -22,16 +22,6 @@ with open(os.path.join(helpers.root, 'api', 'config', 'config.yml'), encoding='u class UserManager: """ Manager of all users in the database. - Following methods are available: - - - `_get_collection(collection_name)` - - `create(discord_id)` - - `user_by_id(user_id)` - - `user_by_discord_id(discord_id)` - - `user_by_api_key(api_key)` - - `update_by_id(user_id, new_obj)` - - `update_by_filter(filter_object, new_obj)` - - `delete(user_id)` """ def __init__(self):