aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/permissions.py
diff options
context:
space:
mode:
authorTom Christie2014-08-20 17:15:46 +0100
committerTom Christie2014-08-20 17:15:46 +0100
commit4d8c63abc996bcb44d7a68dd7a7234b0d9f148a0 (patch)
tree15d175ba67d1a8ef0f1f651a82120ac9263d7d72 /rest_framework/permissions.py
parent9372cc8c31fc5d7b3fb3b155ed88b0b6d3c00049 (diff)
downloaddjango-rest-framework-4d8c63abc996bcb44d7a68dd7a7234b0d9f148a0.tar.bz2
Deprecate .model in related routers/permissions
Diffstat (limited to 'rest_framework/permissions.py')
-rw-r--r--rest_framework/permissions.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/rest_framework/permissions.py b/rest_framework/permissions.py
index 6a1a0077..29f60d6d 100644
--- a/rest_framework/permissions.py
+++ b/rest_framework/permissions.py
@@ -108,6 +108,9 @@ class DjangoModelPermissions(BasePermission):
return [perm % kwargs for perm in self.perms_map[method]]
def has_permission(self, request, view):
+ # Note that `.model` attribute on views is deprecated, although we
+ # enforce the deprecation on the view `get_serializer_class()` and
+ # `get_queryset()` methods, rather than here.
model_cls = getattr(view, 'model', None)
queryset = getattr(view, 'queryset', None)