Checklist
Steps to reproduce
Make an Authentication class:
class AttributeErrorAuthentication(BaseAuthentication):
def authenticate(self, request):
raise AttributeError
def authenticate_header(self, request):
return 'NotImportant'
Set it in DEFAULT_AUTHENTICATION_CLASSES setting:
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'api.authentication.AttributeErrorAuthentication',
)
}
Make a simple view:
class UserView(generics.CreateAPIView, generics.RetrieveAPIView, generics.UpdateAPIView):
serializer_class = UserSerializer
def get_object(self):
return self.request.user
Include an empty DefaultRouter and the UserView in the same urlpatterns :
router = DefaultRouter()
urlpatterns = [
url(r'^', include(router.urls)),
url(r'^user/$', views.UserView.as_view(), name='user-detail'),
]
or register something on it, doesn't matter I think.
Make a request to http://localhost:8000/api/.
Expected behavior
Show AttributeError traceback, HTTP 500 server error
Actual behavior
No traceback, HTTP 200 OK response.
On the /user/ endpoint I got a traceback, but on api_root, nothing.
Checklist
masterbranch of Django REST framework.Steps to reproduce
Make an Authentication class:
Set it in DEFAULT_AUTHENTICATION_CLASSES setting:
Make a simple view:
Include an empty DefaultRouter and the UserView in the same urlpatterns :
or register something on it, doesn't matter I think.
Make a request to
http://localhost:8000/api/.Expected behavior
Show AttributeError traceback, HTTP 500 server error
Actual behavior
No traceback, HTTP 200 OK response.
On the
/user/endpoint I got a traceback, but on api_root, nothing.