Commit de661166 authored by Willard's avatar Willard

Fix errors in dish_view.py

parent 411d9a2d
......@@ -52,12 +52,15 @@ class EditDishView(FormView):
db.session.commit()
return redirect(url_for('view_stall', stall_id=self.stall.id))
def render_get(self, stall_id, dish_id):
form = self.get_form()
form.name.data = self.dish.name
form.description.data = self.dish.description
form.price.data = self.dish.price
return render_template('editdish.html', form=form, stall=self.stall, dish=self.dish)
def get_form(self):
return DishRegisterForm()
form = DishRegisterForm()
form.dish_type.choices = [(dish_type.id, dish_type.name) for dish_type in DishType.query.all()]
return form
class DeleteDishView(View):
decorators = [login_required, dish_validate]
......
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