We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f93a3f9 commit d23f3c0Copy full SHA for d23f3c0
backend/routes/forms/new.py
@@ -26,5 +26,10 @@ async def post(self, request: Request) -> JSONResponse:
26
except ValidationError as e:
27
return JSONResponse(e.errors())
28
29
+ if await request.state.db.forms.find_one({"_id": form.id}):
30
+ return JSONResponse({
31
+ "error": "Form with same ID already exists."
32
+ })
33
+
34
await request.state.db.forms.insert_one(form.dict(by_alias=True))
35
return JSONResponse(form.dict())
0 commit comments