class OverrideClass(cls):
__doc__ = cls.__doc__
__name__ = cls.__name__
@method_decorator(decorator)
...
def apply_decorator(decorator):
def wrap(cls):
class OverrideClass(cls):
@method_decorator(decorator)
def dispatch(self, *args, **kwargs):
return super(OverrideClass, self).dispatch(*args, **kwargs)
return OverrideClass
return wrap
@apply_decorator(login_required)
class ProfileUpdateView(UpdateView):