Skip to content

Commit

Permalink
[Fixes #12361] Fix captcha field visualization in signup page (#12392) (
Browse files Browse the repository at this point in the history
#12393)

* Fix captcha field visualization in signup page

* fix formatting

(cherry picked from commit d3686f8)

Co-authored-by: Giovanni Allegri <[email protected]>
  • Loading branch information
github-actions[bot] and giohappy authored Jul 8, 2024
1 parent d296f7a commit 7197e76
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion geonode/people/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@


class AllauthReCaptchaSignupForm(forms.Form):
captcha = ReCaptchaField()
captcha = ReCaptchaField(label=False)

def signup(self, request, user):
"""Required, or else it thorws deprecation warnings"""
Expand Down
4 changes: 4 additions & 0 deletions geonode/people/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ class CustomSignupView(SignupView):
def get_context_data(self, **kwargs):
ret = super().get_context_data(**kwargs)
ret.update({"account_geonode_local_signup": settings.SOCIALACCOUNT_WITH_GEONODE_LOCAL_SINGUP})
# Push captcha field at the end
form = ret["form"]
form.field_order = [f for f in form.fields.keys() if f != "captcha"] + ["captcha"]
form.order_fields(form.field_order)
return ret


Expand Down
3 changes: 2 additions & 1 deletion geonode/templates/account/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ <h2>{% trans "Sign up" %}</h2>
<script type="text/javascript">
$(document).ready(function() {
$('#id_username').focus();
});
$('#id_captcha').removeClass('form-control');
});
</script>
{% endblock %}

0 comments on commit 7197e76

Please sign in to comment.