Skip to content

Commit 70c0e4a

Browse files
committed
int-ify the form_id when getting response
1 parent 8cad630 commit 70c0e4a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

form-designer/form_designer/pages/response.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@ class ResponsesState(AppState):
1313
def load_responses(self):
1414
if not self.is_authenticated:
1515
return
16+
try:
17+
form_id = int(self.form_id)
18+
except ValueError:
19+
return
1620
with rx.session() as session:
17-
form = session.get(Form, self.form_id)
21+
form = session.get(Form, form_id)
1822
if not self._user_has_access(form) or form is None:
1923
self.form = Form()
2024
return
2125
self.form = form
2226
self.responses = session.exec(
23-
Response.select().where(Response.form_id == self.form_id)
27+
Response.select().where(Response.form_id == form_id)
2428
).all()
2529

2630
def delete_response(self, id: int):

0 commit comments

Comments
 (0)