Skip to content

Commit

Permalink
[bug][xs]: captcha cheeck is required inorder to report
Browse files Browse the repository at this point in the history
  • Loading branch information
sagargg committed Jun 12, 2023
1 parent 40227e2 commit ffdb0fd
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions ckanext/nhs/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,17 +333,16 @@ def post(self, id):
data_dict = {'id': id}

recaptcha = request.form.get('g-recaptcha-token')
if recaptcha:
try:
captcha_result = _reCapatcha_verify(recaptcha)
log.info('Captcha Result: {0}'.format(captcha_result))
if captcha_result['success'] == False:
raise Exception
except Exception as e:
h.flash_error(_('Unable to report dataset, Please verify that you are not a robot.'))
return h.redirect_to(controller='package', action='read', id=data_dict['id'])



try:
captcha_result = _reCapatcha_verify(recaptcha)
log.info('Captcha Result: {0}'.format(captcha_result))
if captcha_result['success'] == False:
raise Exception
except Exception as e:
h.flash_error(_('Unable to report dataset, Please verify that you are not a robot.'))
return h.redirect_to(controller='package', action='read', id=data_dict['id'])

report_dict = {
'issue_type' : request.form.get('type'),
'issue_description' : request.form.get('description'),
Expand Down

0 comments on commit ffdb0fd

Please sign in to comment.