Skip to content

Render the captcha field on the login and register pages - #1297

Merged
swainn merged 3 commits into
tethysplatform:mainfrom
Aquaveo:fix/render-captcha-on-login-register
Aug 17, 2026
Merged

Render the captcha field on the login and register pages#1297
swainn merged 3 commits into
tethysplatform:mainfrom
Aquaveo:fix/render-captcha-on-login-register

Conversation

@romer8

@romer8 romer8 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Description

#1293 switched the login and register forms to an explicit field list to hide labels, which dropped the captcha. With ENABLE_CAPTCHA enabled the field is still required but never rendered, so every submission fails validation and the page re-renders, locking users out. Released in 4.6.0.

Changes Made to Code

  • Render form.captcha, guarded since get_captcha() returns None when disabled.
  • Add tests rendering both pages with captcha enabled and disabled.

romer8 added 2 commits August 15, 2026 13:34
PR tethysplatform#1293 replaced whole-form rendering with an explicit list of fields in
order to hide the labels. Enumerating the fields dropped the captcha, which
is not one of them.

With ENABLE_CAPTCHA enabled the field is still required by LoginForm and
RegisterForm, so every submission fails validation on a field the page never
rendered and the form simply re-renders. That locks all users out of a portal
that has captcha turned on.

Render the field when the form has one. get_captcha returns None when
ENABLE_CAPTCHA is off, in which case the form has no such field and
bootstrap_field would raise, so the tag is guarded.

The gap was untested in both directions: the account view tests mock render
and get_template, and the form tests never render a template. Adds tests that
render both pages with captcha enabled and disabled.
@romer8
romer8 force-pushed the fix/render-captcha-on-login-register branch from 5b5a3b8 to 697ee0e Compare August 17, 2026 20:58
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same — Aquaveo:fix/render-captcha-on-login-register into tethysplatform:main

@swainn
swainn merged commit f030ef9 into tethysplatform:main Aug 17, 2026
38 checks passed
@swainn
swainn deleted the fix/render-captcha-on-login-register branch August 17, 2026 21:57
@swainn swainn added the bugfix label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants