def __init__(self, *args, **kwargs): super(QUserLoginForm, self).__init__(*args, **kwargs) bootstrap_form(self) # replace the default Django authentication error messages... self.error_messages = { "invalid_login": _("Please enter a correct %(username)s and password. " "Note that both fields are case-sensitive."), "inactive": _("This account is inactive. " "Please contact the administrator if you believe this is incorrect."), }
def __init__(self, *args, **kwargs): super(QUserProfileForm, self).__init__(*args, **kwargs) bootstrap_form(self) profile = self.instance user = profile.user self.fields["first_name"].initial = user.first_name self.fields["last_name"].initial = user.last_name self.fields["email"].initial = user.email
def __init__(self, *args, **kwargs): super(QUserPasswordForm, self).__init__(*args, **kwargs) bootstrap_form(self) self.fields["password1"].validators = [validate_no_spaces, validate_password, ] self.fields["password1"].help_text = \ "Passwords must have a minimum length of %s and a mixture of letters and non-letters." % (PASSWORD_LENGTH)