Small fixes

This commit is contained in:
nsde 2023-10-14 01:23:25 +02:00
parent d1085b00c3
commit d1c7180d5d
2 changed files with 12 additions and 10 deletions

12
api/db/helpers.py Normal file
View file

@ -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())

View file

@ -22,16 +22,6 @@ with open(os.path.join(helpers.root, 'api', 'config', 'config.yml'), encoding='u
class UserManager: class UserManager:
""" """
Manager of all users in the database. 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): def __init__(self):