aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/permissions.py
diff options
context:
space:
mode:
authorTom Christie2014-08-29 10:03:07 +0100
committerTom Christie2014-08-29 10:03:07 +0100
commit8f4ae06b3b3b9572d72529ffad1842f63ca67d91 (patch)
tree2fc2c0ce267ae04e69213a810286c8b47b02826f /rest_framework/permissions.py
parentbb1604674f05c0fa5c62e7bb3e7b9d12fd9bf648 (diff)
parent8b2052172cf7138203e683731c30bd279c6e722a (diff)
downloaddjango-rest-framework-8f4ae06b3b3b9572d72529ffad1842f63ca67d91.tar.bz2
Merge pull request #1784 from tomchristie/remove-model-attribute
Deprecate `.model` attribute on views
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)