Commit d519beb9 authored by Willard's avatar Willard

Proper dish_views.py formatting

parent da1dcb2d
...@@ -11,7 +11,7 @@ from flask_login import login_required ...@@ -11,7 +11,7 @@ from flask_login import login_required
from werkzeug.utils import secure_filename from werkzeug.utils import secure_filename
class NewDishView(FormView): class NewDishView(FormView):
decorators=[login_required, stall_validate] decorators = [login_required, stall_validate]
def dispatch_request(self, stall_id): def dispatch_request(self, stall_id):
self.stall = Stall.query.get(stall_id) self.stall = Stall.query.get(stall_id)
return FormView.dispatch_request(self, stall_id) return FormView.dispatch_request(self, stall_id)
...@@ -28,12 +28,12 @@ class NewDishView(FormView): ...@@ -28,12 +28,12 @@ class NewDishView(FormView):
return DishRegisterForm() return DishRegisterForm()
class DishView(View): class DishView(View):
decorators=[login_required, dish_validate] decorators = [login_required, dish_validate]
def dispatch_request(self, stall_id, dish_id): def dispatch_request(self, stall_id, dish_id):
return render_template('viewdish.html', stall=Stall.query.get(stall_id), dish=Dish.query.get(dish_id)) return render_template('viewdish.html', stall=Stall.query.get(stall_id), dish=Dish.query.get(dish_id))
class EditDishView(FormView): class EditDishView(FormView):
decorators=[login_required, dish_validate] decorators = [login_required, dish_validate]
def dispatch_request(self, stall_id, dish_id): def dispatch_request(self, stall_id, dish_id):
self.stall = Stall.query.get(stall_id) self.stall = Stall.query.get(stall_id)
self.dish = Dish.query.get(dish_id) self.dish = Dish.query.get(dish_id)
...@@ -56,7 +56,7 @@ class EditDishView(FormView): ...@@ -56,7 +56,7 @@ class EditDishView(FormView):
return DishRegisterForm() return DishRegisterForm()
class DeleteDishView(View): class DeleteDishView(View):
decorators=[login_required, dish_validate] decorators = [login_required, dish_validate]
def dispatch_request(self, stall_id, dish_id): def dispatch_request(self, stall_id, dish_id):
dish = Dish.query.get(dish_id) dish = Dish.query.get(dish_id)
db.session.delete(dish) db.session.delete(dish)
......
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