datatracker/patch/fix-django-password-strength-kwargs.patch

37 lines
1.4 KiB
Diff

--- django_password_strength/widgets.py.orig 2020-06-24 16:07:28.479533134 +0200
+++ django_password_strength/widgets.py 2020-06-24 16:08:09.540714290 +0200
@@ -8,7 +8,7 @@
Form widget to show the user how strong his/her password is.
"""
- def render(self, name, value, attrs=None):
+ def render(self, name, value, **kwargs):
strength_markup = """
<div style="margin-top: 10px;">
<div class="progress" style="margin-bottom: 10px;">
@@ -30,7 +30,7 @@
except KeyError:
self.attrs['class'] = 'password_strength'
- return mark_safe( super(PasswordInput, self).render(name, value, attrs) + strength_markup )
+ return mark_safe( super(PasswordInput, self).render(name, value, **kwargs) + strength_markup )
class Media:
js = (
@@ -48,7 +48,7 @@
super(PasswordConfirmationInput, self).__init__(attrs, render_value)
self.confirm_with=confirm_with
- def render(self, name, value, attrs=None):
+ def render(self, name, value, **kwargs):
if self.confirm_with:
self.attrs['data-confirm-with'] = 'id_%s' % self.confirm_with
@@ -68,4 +68,4 @@
except KeyError:
self.attrs['class'] = 'password_confirmation'
- return mark_safe( super(PasswordInput, self).render(name, value, attrs) + confirmation_markup )
+ return mark_safe( super(PasswordInput, self).render(name, value, **kwargs) + confirmation_markup )