Skip to content
Snippets Groups Projects
Commit 09d8b1b3 authored by Arno Wunderlich's avatar Arno Wunderlich
Browse files

added check if bidder == seller and error message

parent 5ef37255
No related branches found
No related tags found
1 merge request!49added check if bidder == seller and error message
Pipeline #15675 passed
......@@ -180,6 +180,10 @@ def bid(id):
if item.closes_at < datetime.utcnow():
flash("This item is no longer on sale.")
return redirect(url_for('views.list_bid'))
if item.seller == current_user:
flash("You cannot bid on your own item. Bid was not saved.")
return redirect(url_for('views.list_bid'))
try:
# Notice: if you have integrated the flask-login extension, use current_user
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment