Skip to content

Commit

Permalink
Updated error message for when a user fails Turnstile validation
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuastegmaier committed Sep 18, 2024
1 parent 3e09ed6 commit 444eb53
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions concordia/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ def post(self, request, *args, **kwargs):
if turnstile_form.is_valid():
return self.form_valid(form)
else:
form.add_error(None, "Unable to validate user")
form.add_error(
None, "Unable to validate. Please login or complete the challenge."
)
return self.form_invalid(form)

else:
Expand Down Expand Up @@ -1519,7 +1521,10 @@ def inner(request, *args, **kwargs):
form = TurnstileForm(request.POST)
if not form.is_valid():
return JsonResponse(
{"error": "Unable to validate user"},
{
"error": "Unable to validate. "
"Please login or complete the challenge."
},
status=401,
)
return view(request, *args, **kwargs)
Expand Down

0 comments on commit 444eb53

Please sign in to comment.