Hi Jason,

Thank you for  your response, really appreciate the help. I was working on 
your suggestion but then stumbled across django-password-validators which 
seems to do the required task for me. For now I will go with this one. But 
I will surely include the github for django when learning things to better 
understand how some magis work.

Kind Regards,
Simon Arriola

On Monday, February 11, 2019 at 9:00:57 AM UTC+8, Jason wrote:
>
> ClassyCBV doesn't contain everything in django, so that is probably 
> related to your confusion.
>
> In classycbv PasswordChangeView's attributes, you can see 
> form_class = <class 'django.contrib.auth.forms.PasswordChangeForm'>
> which is what is called in PCV's Post handler 
> <http://ccbv.co.uk/projects/Django/2.1/django.contrib.auth.views/PasswordChangeView/#post>
>
> Now, that form is defined here 
> <https://github.com/django/django/blob/2.1/django/contrib/auth/forms.py#L342>,
>  
> which inherits from SetPasswordForm 
> <https://github.com/django/django/blob/2.1/django/contrib/auth/forms.py#L298>.
>   
> There's two methods inside that class, save, and clean_new_password2 
> <https://github.com/django/django/blob/2.1/django/contrib/auth/forms.py#L322-L339>
>
> Since these forms inherit from forms.Form 
> <https://github.com/django/django/blob/2.1/django/forms/forms.py#L183>, 
> they all inherit is_valid, which has this comment:  
> """Return True if the form has no errors, or False otherwise."""
> So, what you'll need to do is override that `is_valid` method in your 
> custom Form class to do the work for you.
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a6ac258f-b509-4df0-87b7-998dbe42ae72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to