Add manual submit_id uniqueness check as it is not enforced on server
This commit is contained in:
@@ -214,6 +214,14 @@ class SignupViewSet(ModelViewSet):
|
|||||||
return self.partial_update(request, *args, **kwargs)
|
return self.partial_update(request, *args, **kwargs)
|
||||||
|
|
||||||
def create(self, 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"]
|
id = request.data["signupForm_id"]
|
||||||
try:
|
try:
|
||||||
answer = request.data["answer"]
|
answer = request.data["answer"]
|
||||||
|
|||||||
Reference in New Issue
Block a user