-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
My code:
from hcaptcha.hcaptcha import HCaptchaVerifier, HCaptchaVerificationError
hcaptcha_client = HCaptchaVerifier(secret_key="")
@public_blueprint.route('/signup', methods=['GET', 'POST'])
def signup():
if request.method=="POST":
hcatpcha_token=request.form.get('hcatpcha_token')
nickname=request.form.get('nickname')
nombre=request.form.get('name1')
apellido=request.form.get('name2')
email=request.form.get('email')
password=request.form.get('password')
try:
is_valid = asyncio.run(hcaptcha_client.verify(hcatpcha_token))
if is_valid:
cuenta=Accounts(username="", password=password, gmail=email, number="", nombre=" ", apellido="", genero="", fecha_nacimiento="", fecha_registro=datetime.now(), VIP="")
db.session.add(cuenta)
db.session.commit()
else:
print("Captcha INvalido")
return render_template('public/signup.html', msg="No haz completado el captcha!")
except Exception as e:
return e
return render_template('public/signup.html', msg="Hello World")I post to /signup
TypeError
TypeError: The view function did not return a valid response. The return type must be a string, dict, list, tuple with headers or status, Response instance, or WSGI callable, but it was a HCaptchaVerificationError.
Traceback (most recent call last)
File "/home/krootca/nulltech/lib/python3.11/site-packages/flask/app.py", line 1466, in wsgi_app
response = self.handle_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/krootca/nulltech/lib/python3.11/site-packages/flask/app.py", line 1463, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/krootca/nulltech/lib/python3.11/site-packages/flask/app.py", line 873, in full_dispatch_request
return self.finalize_request(rv)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/krootca/nulltech/lib/python3.11/site-packages/flask/app.py", line 892, in finalize_request
response = self.make_response(rv)
^^^^^^^^^^^^^^^^^^^^^^ [Open an interactive python shell in this frame]
File "/home/krootca/nulltech/lib/python3.11/site-packages/flask/app.py", line 1201, in make_response
raise TypeError(
^
TypeError: The view function did not return a valid response. The return type must be a string, dict, list, tuple with headers or status, Response instance, or WSGI callable, but it was a HCaptchaVerificationError.If I can fix this I will editing this text
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels