diff options
| author | Di Wu | 2015-03-16 22:13:07 -0700 | 
|---|---|---|
| committer | Di Wu | 2015-03-16 22:13:07 -0700 | 
| commit | 48e1f151c558306c5528bfd012d134f9ea9e7bfc (patch) | |
| tree | 674a304d18909892e0487f82e3e76ba823b72911 /rest_framework/permissions.py | |
| parent | 2e55d15d4daa38c6dcb6fb43ab41b9a18ce5ca75 (diff) | |
| download | django-rest-framework-48e1f151c558306c5528bfd012d134f9ea9e7bfc.tar.bz2 | |
use SAFE_METHODS and make tuple
Diffstat (limited to 'rest_framework/permissions.py')
| -rw-r--r-- | rest_framework/permissions.py | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/rest_framework/permissions.py b/rest_framework/permissions.py index 9069d315..fcebf046 100644 --- a/rest_framework/permissions.py +++ b/rest_framework/permissions.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals  from django.http import Http404  from rest_framework.compat import get_model_name -SAFE_METHODS = ['GET', 'HEAD', 'OPTIONS'] +SAFE_METHODS = ('GET', 'HEAD', 'OPTIONS')  class BasePermission(object): @@ -185,7 +185,7 @@ class DjangoObjectPermissions(DjangoModelPermissions):              # they have read permissions to see 403, or not, and simply see              # a 404 response. -            if request.method in ('GET', 'OPTIONS', 'HEAD'): +            if request.method in SAFE_METHODS:                  # Read permissions already checked and failed, no need                  # to make another lookup.                  raise Http404 | 
