Bughunting 2. Reconsider datamodel of mongodb and user/pass storage

This commit is contained in:
2022-03-16 15:12:27 +01:00
parent 8ac4d3efc0
commit 93156b1bc4
3 changed files with 23 additions and 12 deletions
+7 -4
View File
@@ -17,14 +17,17 @@ password = getpass.getpass("Password: ")
uuid = str(uuid.uuid4())
email = input("Email-adres: ")
full_name = input("Volledige naam: ")
list_id = ""
col = db["cred"]
user_cred = {"username": username, "password": password, "uuid": uuid}
user_info = {"uuid":uuid, "email": email, "name": full_name ,"listid": list_id}
mydict = {"username": username, "password": password, "uuid": uuid, "email": email, "name": full_name}
if col.find_one({"username": username}):
if db.user_cred.find_one({"username": username}):
print("Username already exists\n")
exit()
else:
x = col.insert_one(mydict)
cred_record = db.user_cred.insert_one(user_cred)
info_record = db.user_info.insert_one(user_info)
print("User created")