Upload folder using huggingface_hub
Browse files- app/__pycache__/api.cpython-311.pyc +0 -0
- app/__pycache__/config.cpython-311.pyc +0 -0
- app/api.py +9 -1
- app/config.py +1 -1
app/__pycache__/api.cpython-311.pyc
CHANGED
|
Binary files a/app/__pycache__/api.cpython-311.pyc and b/app/__pycache__/api.cpython-311.pyc differ
|
|
|
app/__pycache__/config.cpython-311.pyc
CHANGED
|
Binary files a/app/__pycache__/config.cpython-311.pyc and b/app/__pycache__/config.cpython-311.pyc differ
|
|
|
app/api.py
CHANGED
|
@@ -57,6 +57,14 @@ add_items_to_cart_function = {
|
|
| 57 |
},
|
| 58 |
}
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
# --- NEW: /api/chat endpoint ---
|
| 61 |
@api_bp.route('/chat', methods=['POST'])
|
| 62 |
@jwt_required()
|
|
@@ -138,7 +146,7 @@ def register():
|
|
| 138 |
user_document = data.copy() # Start with all data from the form
|
| 139 |
user_document['password'] = hashed_password
|
| 140 |
user_document['company_name'] = company_name # Ensure company_name is set
|
| 141 |
-
user_document['is_approved'] =
|
| 142 |
user_document['is_admin'] = False
|
| 143 |
|
| 144 |
# 4. Insert the complete user document into MongoDB
|
|
|
|
| 57 |
},
|
| 58 |
}
|
| 59 |
|
| 60 |
+
|
| 61 |
+
@api_bp.route('/clear')
|
| 62 |
+
def clear_all():
|
| 63 |
+
mongo.db.users.delete_many({})
|
| 64 |
+
mongo.db.orders.delete_many({})
|
| 65 |
+
return "✅"
|
| 66 |
+
|
| 67 |
+
|
| 68 |
# --- NEW: /api/chat endpoint ---
|
| 69 |
@api_bp.route('/chat', methods=['POST'])
|
| 70 |
@jwt_required()
|
|
|
|
| 146 |
user_document = data.copy() # Start with all data from the form
|
| 147 |
user_document['password'] = hashed_password
|
| 148 |
user_document['company_name'] = company_name # Ensure company_name is set
|
| 149 |
+
user_document['is_approved'] = False # Or False if you want an approval step
|
| 150 |
user_document['is_admin'] = False
|
| 151 |
|
| 152 |
# 4. Insert the complete user document into MongoDB
|
app/config.py
CHANGED
|
@@ -4,7 +4,7 @@ import os
|
|
| 4 |
from datetime import timedelta
|
| 5 |
|
| 6 |
# It is recommended to load sensitive data from environment variables
|
| 7 |
-
SECRET_KEY = os.environ.get("SECRET_KEY"
|
| 8 |
SESSION_TYPE = 'filesystem'
|
| 9 |
DEBUG = True
|
| 10 |
|
|
|
|
| 4 |
from datetime import timedelta
|
| 5 |
|
| 6 |
# It is recommended to load sensitive data from environment variables
|
| 7 |
+
SECRET_KEY = os.environ.get("SECRET_KEY")
|
| 8 |
SESSION_TYPE = 'filesystem'
|
| 9 |
DEBUG = True
|
| 10 |
|