From 6d2ca75d8e2403a17fa7cb2d112f5241a0247226 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Tue, 18 Jun 2013 11:10:56 +0100 Subject: [PATCH] Don't raise AttributeError on views with no model or queryset, when using DjangoModelPermissions --- rest_framework/permissions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/permissions.py b/rest_framework/permissions.py index 45fcfd665..1036663e0 100644 --- a/rest_framework/permissions.py +++ b/rest_framework/permissions.py @@ -128,7 +128,7 @@ class DjangoModelPermissions(BasePermission): # Workaround to ensure DjangoModelPermissions are not applied # to the root view when using DefaultRouter. - if model_cls is None and getattr(view, '_ignore_model_permissions'): + if model_cls is None and getattr(view, '_ignore_model_permissions', False): return True assert model_cls, ('Cannot apply DjangoModelPermissions on a view that'