From 8875bc32ae63a44645c33c679bd26a22da03181c Mon Sep 17 00:00:00 2001 From: Benedek Nagy Date: Sun, 20 Mar 2022 18:57:49 +0000 Subject: [PATCH] mediawiki: Check if admin password is at least 10 characters long Sunil: Current passwords policies as of MediaWiki 1.35.6 do not require capital letter and numeral. Add comment that the password can't be common one. Tests: - Set the admin password to 'testingtesting'. Update should be successful. [sunil: Fix typos] [sunil: Drop checking for capital letter and numeral in password] Signed-off-by: Sunil Mohan Adapa Reviewed-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/mediawiki/forms.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plinth/modules/mediawiki/forms.py b/plinth/modules/mediawiki/forms.py index 0354e3f17..eac74de63 100644 --- a/plinth/modules/mediawiki/forms.py +++ b/plinth/modules/mediawiki/forms.py @@ -51,8 +51,10 @@ class MediaWikiForm(forms.Form): # pylint: disable=W0232 password = forms.CharField( label=_('Administrator Password'), help_text=_( 'Set a new password for MediaWiki\'s administrator account ' - '(admin). Leave this field blank to keep the current password.'), - required=False, widget=forms.PasswordInput) + '(admin). The password cannot be a common one and the minimum ' + 'required length is 10 characters. ' + 'Leave this field blank to keep the current password.'), + required=False, widget=forms.PasswordInput, min_length=10) server_url = forms.CharField( label=_('Server URL'), required=False, help_text=_(