aboutsummaryrefslogtreecommitdiffstats
path: root/backend/routes/forms/submit.py
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2020-12-17 09:38:13 +0300
committerGravatar Hassan Abouelela <[email protected]>2020-12-17 09:38:13 +0300
commitd2427c7d3c3a1e877e99a724106b8d01d356e84c (patch)
treecb35783fb39c8a96c834c6835054bca2e3a2a159 /backend/routes/forms/submit.py
parentAdds Timestamp Field (diff)
Fixes DB Timestamp on Return
As pointed out by @ks129, fetching the responses would cause an error in the timestamp, as the validation was returning the current time at fetching, instead of the stored value. Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'backend/routes/forms/submit.py')
-rw-r--r--backend/routes/forms/submit.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/backend/routes/forms/submit.py b/backend/routes/forms/submit.py
index 3ecbda0..48ae4f6 100644
--- a/backend/routes/forms/submit.py
+++ b/backend/routes/forms/submit.py
@@ -34,6 +34,8 @@ class SubmitForm(Route):
async def post(self, request: Request) -> JSONResponse:
data = await request.json()
+ data["timestamp"] = None
+
if form := await request.state.db.forms.find_one(
{"_id": request.path_params["form_id"], "features": "OPEN"}
):