allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [2/5] allura git commit: [#7459] Add JS validation for pass reset and use from config
Date Mon, 22 Oct 2018 16:30:55 GMT
[#7459] Add JS validation for pass reset and use from config


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/109d81ed
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/109d81ed
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/109d81ed

Branch: refs/heads/master
Commit: 109d81edcad49fed24384b0d873eeb96963b35e5
Parents: f40ef62
Author: Shalitha <shalithasuranga@gmail.com>
Authored: Sat Oct 20 16:44:00 2018 +0530
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Mon Oct 22 16:24:44 2018 +0000

----------------------------------------------------------------------
 Allura/allura/lib/widgets/forms.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/109d81ed/Allura/allura/lib/widgets/forms.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/forms.py b/Allura/allura/lib/widgets/forms.py
index 71d3fca..529ec29 100644
--- a/Allura/allura/lib/widgets/forms.py
+++ b/Allura/allura/lib/widgets/forms.py
@@ -140,6 +140,7 @@ class PasswordChangeBase(ForgeForm):
             ew.PasswordField(
                 name='pw',
                 label='New Password',
+                attrs=dict(minlength=asint(tg.config.get('auth.min_password_len', 6)), maxlength=asint(tg.config.get('auth.max_password_len',
30))),
                 validator=fev.UnicodeString(
                     not_empty=True,
                     min=asint(tg.config.get('auth.min_password_len', 6)),
@@ -157,6 +158,8 @@ class PasswordChangeBase(ForgeForm):
             raise formencode.Invalid('Passwords must match', value, state)
         return d
 
+    def resources(self):
+        yield ew.JSLink('js/password-validator.js')
 
 class PasswordChangeForm(PasswordChangeBase):
 
@@ -170,7 +173,7 @@ class PasswordChangeForm(PasswordChangeBase):
             ew.PasswordField(
                 name='pw',
                 label='New Password',
-                attrs=dict(minlength=6, maxlength=30),
+                attrs=dict(minlength=asint(tg.config.get('auth.min_password_len', 6)), maxlength=asint(tg.config.get('auth.max_password_len',
30))),
                 validator=fev.UnicodeString(
                     not_empty=True,
                     min=asint(tg.config.get('auth.min_password_len', 6)),
@@ -191,8 +194,6 @@ class PasswordChangeForm(PasswordChangeBase):
                 value, state)
         return d
 
-    def resources(self):
-        yield ew.JSLink('js/password-validator.js')
 
 class PersonalDataForm(ForgeForm):
     _fields = None
@@ -774,7 +775,7 @@ class RegistrationForm(ForgeForm):
             ew.PasswordField(
                 name='pw',
                 label='New Password',
-                attrs=dict(minlength=6, maxlength=30),
+                attrs=dict(minlength=asint(tg.config.get('auth.min_password_len', 6)), maxlength=asint(tg.config.get('auth.max_password_len',
30))),
                 validator=fev.UnicodeString(
                     not_empty=True,
                     min=asint(tg.config.get('auth.min_password_len', 6)),


Mime
View raw message