Spaces:
Sleeping
Sleeping
Soham Chandratre
commited on
Commit
·
dc7a5e5
1
Parent(s):
5de6376
minor changes
Browse files- routes/route.py +5 -5
- schema/model.py +1 -3
routes/route.py
CHANGED
@@ -32,8 +32,8 @@ async def register_admin(admin: Admin):
|
|
32 |
hashed_password = hash_password(admin.password)
|
33 |
admin_dict = admin.dict()
|
34 |
admin_dict['password'] = hashed_password
|
35 |
-
activation_otp = generate_otp()
|
36 |
-
admin_dict['otp'] = activation_otp
|
37 |
result = admin_collection.insert_one(admin_dict)
|
38 |
return {"message": "Admin created successfully", "user_id": str(result.inserted_id)}
|
39 |
|
@@ -89,10 +89,10 @@ async def create_user(user: User):
|
|
89 |
hashed_password = hash_password(user.password)
|
90 |
user_dict = user.dict()
|
91 |
user_dict['password'] = hashed_password
|
92 |
-
activation_otp = generate_otp()
|
93 |
-
user_dict['otp'] = activation_otp
|
94 |
# Send activation email
|
95 |
-
send_activation_email(user.email, activation_otp)
|
96 |
# result = user_collection.insert_one(user_dict)
|
97 |
# return {"message": "User created successfully. Activation email sent.",}
|
98 |
result = user_collection.insert_one(user_dict)
|
|
|
32 |
hashed_password = hash_password(admin.password)
|
33 |
admin_dict = admin.dict()
|
34 |
admin_dict['password'] = hashed_password
|
35 |
+
# activation_otp = generate_otp()
|
36 |
+
# admin_dict['otp'] = activation_otp
|
37 |
result = admin_collection.insert_one(admin_dict)
|
38 |
return {"message": "Admin created successfully", "user_id": str(result.inserted_id)}
|
39 |
|
|
|
89 |
hashed_password = hash_password(user.password)
|
90 |
user_dict = user.dict()
|
91 |
user_dict['password'] = hashed_password
|
92 |
+
# activation_otp = generate_otp()
|
93 |
+
# user_dict['otp'] = activation_otp
|
94 |
# Send activation email
|
95 |
+
# send_activation_email(user.email, activation_otp)
|
96 |
# result = user_collection.insert_one(user_dict)
|
97 |
# return {"message": "User created successfully. Activation email sent.",}
|
98 |
result = user_collection.insert_one(user_dict)
|
schema/model.py
CHANGED
@@ -7,7 +7,6 @@ class Admin(BaseModel):
|
|
7 |
email :str
|
8 |
password :str
|
9 |
phoneNo :str
|
10 |
-
otp : int
|
11 |
isVerified : bool = True
|
12 |
role:str = 'admin'
|
13 |
|
@@ -18,8 +17,7 @@ class User(BaseModel):
|
|
18 |
email :str
|
19 |
password :str
|
20 |
phoneNo :str
|
21 |
-
|
22 |
-
isVerified : bool = False
|
23 |
role:str = 'user'
|
24 |
|
25 |
|
|
|
7 |
email :str
|
8 |
password :str
|
9 |
phoneNo :str
|
|
|
10 |
isVerified : bool = True
|
11 |
role:str = 'admin'
|
12 |
|
|
|
17 |
email :str
|
18 |
password :str
|
19 |
phoneNo :str
|
20 |
+
isVerified : bool = True
|
|
|
21 |
role:str = 'user'
|
22 |
|
23 |
|