I believe this will fail on class-based views, which don't have a `__name__` attribute.