1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-03 07:55:36 +00:00

Change password length of a enc repo to 30

This commit is contained in:
zhengxie
2013-01-25 10:40:21 +08:00
parent bd52fff6f9
commit 4657ed0159
4 changed files with 13 additions and 14 deletions

View File

@@ -62,15 +62,15 @@ class RepoCreateForm(forms.Form):
'max_length': _(u'Description is too long (maximum is 100 characters)')
})
encryption = forms.CharField(max_length=1)
passwd = forms.CharField(min_length=3, max_length=15, required=False,
passwd = forms.CharField(min_length=3, max_length=30, required=False,
error_messages={
'min_length': _(u'Password is too short (minimum is 3 characters)'),
'max_length': _(u'Password is too long (maximum is 15 characters)'),
'max_length': _(u'Password is too long (maximum is 30 characters)'),
})
passwd_again = forms.CharField(min_length=3, max_length=15, required=False,
passwd_again = forms.CharField(min_length=3, max_length=30, required=False,
error_messages={
'min_length': _(u'Password is too short (minimum is 3 characters)'),
'max_length': _(u'Password is too long (maximum is 15 characters)'),
'max_length': _(u'Password is too long (maximum is 30 characters)'),
})
def clean_repo_name(self):

View File

@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-01-23 14:15+0800\n"
"POT-Creation-Date: 2013-01-25 10:34+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -43,11 +43,11 @@ msgstr "描述太长不超过100个汉字"
#: forms.py:67 forms.py:72 templates/snippets/repo_create_js.html:41
msgid "Password is too short (minimum is 3 characters)"
msgstr "密码太短不少于3个字)"
msgstr "密码太短不少于3个字"
#: forms.py:68 forms.py:73 templates/snippets/repo_create_js.html:45
msgid "Password is too long (maximum is 15 characters)"
msgstr "密码太长(不超过15个汉字"
msgid "Password is too long (maximum is 30 characters)"
msgstr "密码太长(不超过30个字符"
#: forms.py:79
#, python-format
@@ -2046,8 +2046,8 @@ msgid "Encrypt"
msgstr "加密"
#: templates/snippets/repo_create_form.html:17
msgid "(3-15 characters)"
msgstr "(3到15个字符)"
msgid "(at lease 3 characters)"
msgstr "(至少3个字符)"
#: templates/snippets/repo_create_form.html:19
msgid "Password again"
@@ -2102,4 +2102,3 @@ msgstr "备注(可选)"
#: utils/__init__.py:69
msgid "permissiong error"
msgstr "权限错误"

View File

@@ -14,7 +14,7 @@
{% endif %}
<div class="repo-create-encryption">
<input type="checkbox" name="encryption" id="encrypt-switch" /><label>{% trans "Encrypt"%}</label><br />
<label>{% trans "Password"%}</label><span class="tip">{% trans "(3-15 characters)"%}</span><br />
<label>{% trans "Password"%}</label><span class="tip">{% trans "(at lease 3 characters)"%}</span><br />
<input type="password" name="passwd" disabled="disabled" class="passwd input-disabled" /><br />
<label>{% trans "Password again"%}</label><br />
<input type="password" name="passwd_again" disabled="disabled" class="passwd input-disabled" />

View File

@@ -41,8 +41,8 @@ $('#repo-create-form').submit(function() {
apply_form_error(form, "{% trans "Password is too short (minimum is 3 characters)" %}");
return false;
}
if ($.trim(passwd.val()).length > 15) {
apply_form_error(form, "{% trans "Password is too long (maximum is 15 characters)" %}");
if ($.trim(passwd.val()).length > 30) {
apply_form_error(form, "{% trans "Password is too long (maximum is 30 characters)" %}");
return false;
}
if (!$.trim(passwd_again.val())) {