Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ print("Salesforce connection established.")
|
|
20 |
app.secret_key = os.getenv("SECRET_KEY", "sSSjyhInIsUohKpG8sHzty2q") # Replace with a secure key
|
21 |
|
22 |
# Register Blueprints after Flask app is created
|
23 |
-
app.register_blueprint(menu_page)
|
24 |
|
25 |
# Configure the session type
|
26 |
app.config["SESSION_TYPE"] = "filesystem" # Use filesystem for session storage
|
@@ -404,9 +404,6 @@ def signup():
|
|
404 |
|
405 |
return render_template("signup.html")
|
406 |
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
@app.route("/login", methods=["GET", "POST"])
|
411 |
def login():
|
412 |
if request.method == "POST":
|
@@ -453,7 +450,7 @@ def login():
|
|
453 |
new_reward_points = reward_points - 500
|
454 |
sf.Customer_Login__c.update(user['Id'], {"Reward_Points__c": new_reward_points})
|
455 |
|
456 |
-
return redirect(url_for("menu"))
|
457 |
|
458 |
else:
|
459 |
print("Invalid credentials!")
|
@@ -466,8 +463,6 @@ def login():
|
|
466 |
return render_template("login.html")
|
467 |
|
468 |
|
469 |
-
|
470 |
-
|
471 |
@app.route("/cart", methods=["GET"])
|
472 |
def cart():
|
473 |
email = session.get('user_email')
|
|
|
20 |
app.secret_key = os.getenv("SECRET_KEY", "sSSjyhInIsUohKpG8sHzty2q") # Replace with a secure key
|
21 |
|
22 |
# Register Blueprints after Flask app is created
|
23 |
+
app.register_blueprint(menu_page, url_prefix="/menu_page") # Optional: you can add a URL prefix
|
24 |
|
25 |
# Configure the session type
|
26 |
app.config["SESSION_TYPE"] = "filesystem" # Use filesystem for session storage
|
|
|
404 |
|
405 |
return render_template("signup.html")
|
406 |
|
|
|
|
|
|
|
407 |
@app.route("/login", methods=["GET", "POST"])
|
408 |
def login():
|
409 |
if request.method == "POST":
|
|
|
450 |
new_reward_points = reward_points - 500
|
451 |
sf.Customer_Login__c.update(user['Id'], {"Reward_Points__c": new_reward_points})
|
452 |
|
453 |
+
return redirect(url_for("menu_page.menu"))
|
454 |
|
455 |
else:
|
456 |
print("Invalid credentials!")
|
|
|
463 |
return render_template("login.html")
|
464 |
|
465 |
|
|
|
|
|
466 |
@app.route("/cart", methods=["GET"])
|
467 |
def cart():
|
468 |
email = session.get('user_email')
|