Commit 4bdab473 authored by Willard's avatar Willard

Make string literal enclosures consistent

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