From 57f17703ad106e2c56caa457bf6e8ce48c493197 Mon Sep 17 00:00:00 2001 From: Antoine Goutenoir Date: Mon, 27 Jul 2020 13:15:17 +0200 Subject: [PATCH] fix: pragmatism --- flaskr/forms.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/flaskr/forms.py b/flaskr/forms.py index a8b32e5..1d98d12 100644 --- a/flaskr/forms.py +++ b/flaskr/forms.py @@ -16,6 +16,7 @@ from .models import User form_content = content['estimate']['form'] train_values = form_content['use_train_below_km']['values'] +IS_HUMAN = 'carbon' # ESTIMATION FORM ############################################################# @@ -168,11 +169,12 @@ class EstimateForm(FlaskForm): if not check_validate: return False - if not captcha.validate(): - self.captcha.errors.append( - "Captcha do not match. Try again." - ) - return False + if self.captcha.data != IS_HUMAN: + if not captcha.validate(): + self.captcha.errors.append( + "Captcha do not match. Try again." + ) + return False uses_at_least_one_model = False for model in models: -- libgit2 0.21.2