Commit 4bdab473 authored by Willard's avatar Willard

Make string literal enclosures consistent

parent 5b869564
......@@ -31,7 +31,7 @@ def all():
@app.route('/api/search/dish')
def search():
query = request.args.get('name')
result = Dish.query.filter(Dish.name.like("%" + query + "%")).all()
result = Dish.query.filter(Dish.name.like('%' + query + '%')).all()
data = []
for dish in result:
data.append({
......@@ -43,7 +43,7 @@ def search():
})
return jsonify(data)
@app.route('/api/users/new', methods=["POST"])
@app.route('/api/users/new', methods=['POST'])
def new_user():
username = request.form['username']
email = request.form['email']
......
......@@ -66,7 +66,7 @@ def stall(stall_id):
dishes = stall.dishes.all()
return render_template('stall.html', stall=stall, dishes=dishes, upload_folder=app.config['UPLOAD_FOLDER'])
@app.route('/stalls/new', methods=["GET","POST"])
@app.route('/stalls/new', methods=['GET','POST'])
@login_required
def new_stall():
form = StallRegisterForm()
......@@ -123,7 +123,7 @@ def delete_stall(stall_id):
return redirect(url_for('stalls'))
@app.route('/stalls/<int:stall_id>/dish/new', methods=["GET","POST"])
@app.route('/stalls/<int:stall_id>/dish/new', methods=['GET','POST'])
@login_required
def new_dish(stall_id):
stall = Stall.query.filter_by(id=int(stall_id)).first()
......@@ -205,4 +205,4 @@ def unauthorized():
def flash_form_errors(form):
for field, errors in form.errors.items():
for error in errors:
flash(u"Error in the %s field - %s" % (getattr(form, field).label.text, error))
flash(u'Error in the %s field - %s' % (getattr(form, field).label.text, error))
from canteeneo import app
app.run(host="0.0.0.0", port=5000, debug=True)
\ No newline at end of file
app.run(host='0.0.0.0', port=5000, debug=True)
\ No newline at end of file
Markdown is supported
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