add_user.py more info to store. Email and full name added to db entry

This commit is contained in:
2022-03-14 09:55:22 +01:00
parent 4db0b1943c
commit 2462111eea
+3 -2
View File
@@ -6,12 +6,13 @@ myclient = pymongo.MongoClient("mongodb://admin:pass@localhost:27017/")
username = input("Username: ") username = input("Username: ")
password = getpass.getpass("Password: ") password = getpass.getpass("Password: ")
uuid = str(uuid.uuid4()) uuid = str(uuid.uuid4())
email = input("Email-adres")
full_name = input("Volledige naam")
mydb = myclient["groclist_db"] mydb = myclient["groclist_db"]
mycol = mydb["groclist_users"] mycol = mydb["groclist_users"]
mydict = {"username": username, "password": password, "groclist_uuid": uuid} mydict = {"username": username, "password": password, "groclist_uuid": uuid, "email": email, "name": full_name}
if mycol.find_one({"username": username}): if mycol.find_one({"username": username}):
print("Username already exists\n") print("Username already exists\n")
exit() exit()