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 4d8ba23 commit bad10a3Copy full SHA for bad10a3
captcha/views.py
@@ -1,8 +1,15 @@
1
from django.shortcuts import redirect
2
+from rest_framework.response import Response
3
+from rest_framework import status
4
5
from .captchas import setcaptcha
6
7
# Create your views here.
8
def getcaptcha(request, key):
9
+ if not key.isdigit():
10
+ return Response({
11
+ "detail": "Only digit is allow in captcha key"
12
+ }, status=status.HTTP_400_BAD_REQUEST)
13
+
14
setcaptcha(key)
15
return redirect("/media/captcha/{name}.png".format(name=key))
0 commit comments