account/services/authentication.py
def change_password_handler(
            request: object, change_password_form: object) -> object:
        """The method that is responsible for changing the account password."""
        user = User.objects.get(username=request.user.username)

        password1 = change_password_form.cleaned_data.get('password1')
        password2 = change_password_form.cleaned_data.get('password2')

        user.password = make_password(password2)
        user.save()

        login(request, user)

        return JsonResponse({'message': 'ok'})
The method that is responsible for changing the account password.
The method that is responsible for changing the account password.
The method that is responsible for changing the account password .
def change_password_handler(
            request: object, change_password_form: object) -> object:
        user = User.objects.get(username=request.user.username)
        password1 = change_password_form.cleaned_data.get('password1')
        password2 = change_password_form.cleaned_data.get('password2')
        user.password = make_password(password2)
        user.save()
        login(request, user)
        return JsonResponse({'message': 'ok'})
def change_password_handler ( request : object , change_password_form : object ) -> object : user = User . objects . get ( username = request . user . username ) password1 = change_password_form . cleaned_data . get ( 'password1' ) password2 = change_password_form . cleaned_data . get ( 'password2' ) user . password = make_password ( password2 ) user . save ( ) login ( request , user ) return JsonResponse ( { 'message' : 'ok' } )
The method that is responsible for changing the account password.
The method that is responsible for changing the account password .
"""The method that is responsible for changing the account password."""
request
object
change_password_form
object