Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
e85ef3b4
Commit
e85ef3b4
authored
Aug 18, 2014
by
Tom Christie
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1772 from tomchristie/fix-1583
Copy filter_backends class attribute before returning it.
parents
d34dfc3f
9f3c7e89
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
+8
-1
rest_framework/generics.py
+8
-1
No files found.
rest_framework/generics.py
View file @
e85ef3b4
...
...
@@ -189,7 +189,13 @@ class GenericAPIView(views.APIView):
"""
Returns the list of filter backends that this view requires.
"""
filter_backends
=
self
.
filter_backends
or
[]
if
self
.
filter_backends
is
None
:
filter_backends
=
[]
else
:
# Note that we are returning a *copy* of the class attribute,
# so that it is safe for the view to mutate it if needed.
filter_backends
=
list
(
self
.
filter_backends
)
if
not
filter_backends
and
self
.
filter_backend
:
warnings
.
warn
(
'The `filter_backend` attribute and `FILTER_BACKEND` setting '
...
...
@@ -199,6 +205,7 @@ class GenericAPIView(views.APIView):
PendingDeprecationWarning
,
stacklevel
=
2
)
filter_backends
=
[
self
.
filter_backend
]
return
filter_backends
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment