Customized change password and reset password

I have been working on creating a customized forgot password and reset password form using django’s inbuilt password change and reset view
But I am getting below error


 File "/Users/mind1/PycharmProjects/E-commerce/venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/Users/mind1/PycharmProjects/E-commerce/venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Users/mind1/PycharmProjects/E-commerce/venv/lib/python3.10/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/Users/mind1/PycharmProjects/E-commerce/users/views.py", line 110, in change_password
    if form.is_valid():
  File "/Users/mind1/PycharmProjects/E-commerce/venv/lib/python3.10/site-packages/django/forms/forms.py", line 177, in is_valid
    return self.is_bound and not self.errors
  File "/Users/mind1/PycharmProjects/E-commerce/venv/lib/python3.10/site-packages/django/forms/forms.py", line 172, in errors
    self.full_clean()
  File "/Users/mind1/PycharmProjects/E-commerce/venv/lib/python3.10/site-packages/django/forms/forms.py", line 374, in full_clean
    self._clean_fields()
  File "/Users/mind1/PycharmProjects/E-commerce/venv/lib/python3.10/site-packages/django/forms/forms.py", line 386, in _clean_fields
    value = field.widget.value_from_datadict(self.data, self.files, self.add_prefix(name))
  File "/Users/mind1/PycharmProjects/E-commerce/venv/lib/python3.10/site-packages/django/forms/widgets.py", line 258, in value_from_datadict
    return data.get(name)
AttributeError: 'ChangePasswordForm' object has no attribute 'get'

views.py

 form = ChangePasswordForm(request.user,request.POST)
        if form.is_valid():
            form.save()
            # Logs out the current user from the session
            logger.info("Password of user with name {0} edited successfully".format(request.user.username))
            messages.success(request, message="Password changed successfully")
            return redirect('login')


class ChangePasswordForm(PasswordChangeForm):
    old_password = forms.CharField(
        strip=False,
        widget=forms.PasswordInput(
            attrs={'autocomplete': 'current-password', 'autofocus': True, 'class': 'form-control',
                   'placeholder': 'Old Password'}),
    )
    new_password1 = forms.CharField(
        widget=forms.PasswordInput(
            attrs={'autocomplete': 'new-password', 'class': 'form-control', 'placeholder': 'New Password'}),
        strip=False,
        help_text=password_validation.password_validators_help_text_html(),
    )
    new_password2 = forms.CharField(
        strip=False,
        widget=forms.PasswordInput(
            attrs={'autocomplete': 'new-password', 'class': 'form-control', 'placeholder': 'Confirm password'}),
    )

That is not how you create a form from a request. There’s no request.user parameter in the standard form constructor. If necessary, review the docs at Working with forms | Django documentation | Django

Thanks for replying @KenWhitesell

So, How should I pass user object to django’s inbuilt PasswordChangeForm?

Why do you need the User in the Form?

The processing of the password supplied to the form is done in the view, not in the form.