Commit 31985746 authored by arun.uday's avatar arun.uday

second commit

parent 7c0e6a3d
^
..idea/inspectionProfiles/profiles_settings.xml,1\e\1e9075f5bf079c01ef2c910709e91a497d262080
\
,.idea/inspectionProfiles/Project_Default.xml,4\9\496a238a6afa168dbaf6efd37bb459331589579c
\ No newline at end of file
class DatabaseConstants: class DatabaseConstants:
collection_user_details = "userDetails" collection_user_details = "UserDetails"
collection_user_roles = "userRoles" collection_user_roles = "UserRoles"
collection_user_devices = "userDevices" collection_user_devices = "UserDevices"
...@@ -10,19 +10,21 @@ from scripts.utils.mongo_sync import MongoCollectionBaseClass ...@@ -10,19 +10,21 @@ from scripts.utils.mongo_sync import MongoCollectionBaseClass
obj_mongo = MongoCollectionBaseClass(mongo_client=MongoClient(), database="userDB", obj_mongo = MongoCollectionBaseClass(mongo_client=MongoClient(), database="userDB",
collection=DatabaseConstants.collection_user_details) collection=DatabaseConstants.collection_user_details)
project_id = "1256"
while True: while True:
name = input("Enter the name") name = input("Enter the name")
email = input("Enter email") email = input("Enter email")
password = input("enter password") password = input("enter password")
salt = bcrypt.gensalt() pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
hashed_password = bcrypt.hashpw(password, salt) hashed_password = pwd_context.hash(password)
is_alive = True is_alive = True
user_role = "super admin" user_role = "super admin"
# Create a Python datetime object # Create a Python datetime object
dt = datetime.datetime.now() dt = datetime.datetime.now()
created_at = datetime.datetime.now() created_at = datetime.datetime.now()
updated_at = datetime.datetime.now() updated_at = datetime.datetime.now()
obj_mongo.insert_one({"name": name, "email": email, "password": password, "user_role": user_role, obj_mongo.insert_one({"project_id": project_id, "name": name, "email": email, "password": hashed_password,
"user_role": user_role,
"is_alive": is_alive, "created_at": created_at, "is_alive": is_alive, "created_at": created_at,
"updated_at": updated_at}) "updated_at": updated_at})
break break
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment