Commit 30ea4d5c authored by Willard's avatar Willard

Fix syntax errors

parent 423d015e
...@@ -19,7 +19,7 @@ class NewStallView(FormView): ...@@ -19,7 +19,7 @@ class NewStallView(FormView):
stall = Stall(form.name.data, form.description.data, current_user.id, form.location.data) stall = Stall(form.name.data, form.description.data, current_user.id, form.location.data)
db.session.add(stall) db.session.add(stall)
db.session.commit() db.session.commit()
return redirect(url_for('view_stall', stall_id=stall.id)) return redirect(url_for('view_stall', stall_id=self.stall.id))
def render_get(self): def render_get(self):
return render_template('newstall.html', form=self.get_form()) return render_template('newstall.html', form=self.get_form())
def get_form(self): def get_form(self):
...@@ -44,14 +44,14 @@ class EditStallView(FormView): ...@@ -44,14 +44,14 @@ class EditStallView(FormView):
self.stall.name = form.name.data self.stall.name = form.name.data
self.stall.description = form.description.data self.stall.description = form.description.data
self.stall.location_id = form.location.data self.stall.location_id = form.location.data
db.session.connect() db.session.commit()
return redirect(url_for('view_stall', stall_id=stall_id)) return redirect(url_for('view_stall', stall_id=stall_id))
def render_get(self, stall_id): def render_get(self, stall_id):
form = self.get_form() form = self.get_form()
form.name.data = self.stall.name form.name.data = self.stall.name
form.description.data = self.stall.description form.description.data = self.stall.description
form.location.data = self.stall.location_id form.location.data = self.stall.location_id
return render_template('editstall.html', form=form, stall=stall) return render_template('editstall.html', form=form, stall=self.stall)
def get_form(self): def get_form(self):
form = StallRegisterForm() form = StallRegisterForm()
form.location.choices = [(loc.id, loc.name) for loc in Location.query.all()] form.location.choices = [(loc.id, loc.name) for loc in Location.query.all()]
......
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