1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-25 14:50:29 +00:00

Merge pull request #1084 from haiwen/update-config

update True/False check when use constance.config
This commit is contained in:
xiez
2016-04-09 15:38:14 +08:00
2 changed files with 5 additions and 5 deletions

View File

@@ -143,8 +143,8 @@ class SetPasswordForm(forms.Form):
if 'new_password1' in self.cleaned_data:
pwd = self.cleaned_data['new_password1']
if config.USER_STRONG_PASSWORD_REQUIRED is True:
if is_user_password_strong(pwd) is True:
if bool(config.USER_STRONG_PASSWORD_REQUIRED) is True:
if bool(is_user_password_strong(pwd)) is True:
return pwd
else:
raise forms.ValidationError(

View File

@@ -382,7 +382,7 @@ class RegistrationBackend(object):
site = RequestSite(request)
from registration.models import RegistrationProfile
if config.ACTIVATE_AFTER_REGISTRATION is True:
if bool(config.ACTIVATE_AFTER_REGISTRATION) is True:
# since user will be activated after registration,
# so we will not use email sending, just create acitvated user
new_user = RegistrationProfile.objects.create_active_user(username, email,
@@ -523,8 +523,8 @@ class RegistrationForm(forms.Form):
if 'password1' in self.cleaned_data:
pwd = self.cleaned_data['password1']
if config.USER_STRONG_PASSWORD_REQUIRED is True:
if is_user_password_strong(pwd) is True:
if bool(config.USER_STRONG_PASSWORD_REQUIRED) is True:
if bool(is_user_password_strong(pwd)) is True:
return pwd
else:
raise forms.ValidationError(