Commit c31133c3 authored by Mathis Dedial's avatar Mathis Dedial
Browse files

Send user back to voting page if they have already created a burger

parent b1a38687
Pipeline #2687 skipped with stage
......@@ -168,7 +168,9 @@ def create():
# Check that the user hasn't already created a burger
if Burger.query.filter_by(nethz=g.user).first():
return die('You can only create one burger.')
# In this case, send the user back to the voting page
flash('You can only create one burger.', 'error')
return redirect(url_for('index'))
# All set, now save the burger in the database
burger = Burger(
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment