Removed redirection code as not needed

This commit is contained in:
Luke Else 2024-01-23 13:30:18 +00:00
parent e97631a6f4
commit 1f518ff56d

View File

@ -75,7 +75,7 @@ def display_add_product():
# User needs to be logged in as a seller to view this page # User needs to be logged in as a seller to view this page
if not is_role("Seller"): if not is_role("Seller"):
flash("You must be logged in as a seller to view this page!") flash("You must be logged in as a seller to view this page!")
return redirect("/", code=401) return redirect("/")
return render_template('index.html', content='new_product.html') return render_template('index.html', content='new_product.html')
@ -90,7 +90,7 @@ def add_product():
# User needs to be logged in as a seller to view this page # User needs to be logged in as a seller to view this page
if not is_role("Seller"): if not is_role("Seller"):
flash("You must be logged in as a seller to view this page!") flash("You must be logged in as a seller to view this page!")
return redirect("/", code=401) return redirect("/")
file = request.files.get('image') file = request.files.get('image')
@ -127,7 +127,7 @@ def display_own_products():
# User must be logged in as seller to view page # User must be logged in as seller to view page
if not is_role("Seller"): if not is_role("Seller"):
flash("You must be logged in as a seller to view this page!") flash("You must be logged in as a seller to view this page!")
return redirect("/", code=401) return redirect("/")
db = ProductController() db = ProductController()
products = db.read_user(user_id) products = db.read_user(user_id)