Skip to content

Commit

Permalink
Merge branch 'update_login_form' into 'main'
Browse files Browse the repository at this point in the history
Avoid displaying password strength progress bar in login form

See merge request yaal/canaille!218
  • Loading branch information
SbirLobo committed Jan 14, 2025
2 parents d96960a + 88b5ae6 commit d0b32e3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[0.0.60] - Unreleased

Changed
^^^^^^^
- Avoid displaying password strength progress bar in login form

[0.0.59] - 2025-01-10
---------------------

Expand Down
2 changes: 2 additions & 0 deletions canaille/core/endpoints/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class PasswordResetForm(Form):
],
render_kw={
"autocomplete": "new-password",
"class": "password_strength",
},
)
confirmation = wtforms.PasswordField(
Expand Down Expand Up @@ -215,6 +216,7 @@ def available_language_choices():
],
render_kw={
"autocomplete": "new-password",
"class": "password_strength",
},
),
password2=wtforms.PasswordField(
Expand Down
3 changes: 2 additions & 1 deletion canaille/templates/macro/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@
{% endfor %}
{% endif %}

{% if (field.name == "password1" or field.name == "password") and field.data|password_strength and not field.errors %}
{% set display_strength_indicator = field.render_kw and "class" in field.render_kw and "password_strength" in field.render_kw["class"] %}
{% if display_strength_indicator and field.data|password_strength and not field.errors %}
<div>
<p class="progress_bar">{% trans %}Password strength{% endtrans %}</p>
<div class="ui indicating progress" data-percent="{{ field.data|password_strength }}">
Expand Down

0 comments on commit d0b32e3

Please sign in to comment.