add_user.py more info to store. Email and full name added to db entry
This commit is contained in:
+3
-2
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user