forked from open-webui/open-webui
feat: set first user to admin by default
This commit is contained in:
parent
07d2c9871f
commit
83ff1d77ea
8 changed files with 28 additions and 25 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue