def METHOD_NAME(self):
    password1 = self.cleaned_data.get('password1')
    password2 = self.cleaned_data.get('password2')
    if password1 and password2:
        if password1 != password2:
            raise forms.ValidationError(
                _('Passwords do not match. Please enter the same password in both fields.')
            )
    validate_password(password2, self.user)
    return password2