Update index.py

This commit is contained in:
Mr Chen
2024-05-03 00:48:08 +08:00
parent 1b6f54e6a5
commit 8c4820046a
+1 -4
View File
@@ -566,16 +566,13 @@ def addDb():
username = data_name
client['data_name'].insert_one({})
# print(data_name)
client[data_name].chat.insert_one({})
user_roles = [{'role': 'dbOwner', 'db': data_name}, {'role': 'userAdmin', 'db': data_name}]
if auth_status:
db.command("dropUser", username)
db.command("createUser", username, pwd=password, roles=user_roles)
ps = args['ps']
if ps == '':
ps = data_name