Q:

Change Overriden Django Views Return URL

I want to change the return url of a django-allauth page. 
I know I could override the entire function in views.py and just change the return url at the bottom, but doesn't seem ideal as it could cause issues if associated code in the django-allauth package gets changed by the packages authors. 
Is there a better way to do this? 
Thank you. 

A:

How I ended up doing this:
from allauth.account.views import PasswordChangeView
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import reverse

class CustomPasswordChangeView(LoginRequiredMixin, PasswordChangeView):

    def get_success_url(self):

        if [...]:
            success_url = reverse([...], kwargs={'username': self.request.user.username})
        else:
            success_url = reverse([...], kwargs={'username': self.request.user.username})

        return success_url

custom_password_change = login_required(CustomPasswordChangeView.as_view())

