feat: set first user to admin by default

This commit is contained in:
Timothy J. Baek 2023-11-19 00:41:29 -08:00
parent 07d2c9871f
commit 83ff1d77ea
8 changed files with 28 additions and 25 deletions

View file

@ -81,6 +81,9 @@ class UsersTable:
)
]
def get_num_users(self) -> Optional[int]:
return self.table.count_documents({})
def update_user_by_id(self, id: str, updated: dict) -> Optional[UserModel]:
user = self.table.find_one_and_update(
{"id": id}, {"$set": updated}, return_document=ReturnDocument.AFTER