From 9a2168e47f785347ae39a7308a9a547417b2cde3 Mon Sep 17 00:00:00 2001 From: Justus Ojala Date: Mon, 13 Oct 2025 20:20:29 +0300 Subject: [PATCH] Add manual submit_id uniqueness check as it is not enforced on server --- webapp/views.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/webapp/views.py b/webapp/views.py index 8ab4767..95ed3dd 100644 --- a/webapp/views.py +++ b/webapp/views.py @@ -214,6 +214,14 @@ class SignupViewSet(ModelViewSet): return self.partial_update(request, *args, **kwargs) def create(self, request, *args, **kwargs): + # Temporary manual duplicate check as submit_id uniqueness is not enforced in deployment database + if "submit_id" in request.data and Signup.objects.filter( + submit_id=request.data["submit_id"] + ): + return JsonResponse( + status=200, data={"message": "I heard you the first time"} + ) + id = request.data["signupForm_id"] try: answer = request.data["answer"]