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
5a59f339
Commit
5a59f339
authored
Apr 27, 2011
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Urg. Fixing broken merge
parent
b1830258
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
14 deletions
+12
-14
djangorestframework/authenticators.py
+1
-1
djangorestframework/emitters.py
+7
-1
djangorestframework/resource.py
+4
-0
examples/blogpost/tests.py
+0
-6
examples/pygments_api/tests.py
+0
-6
No files found.
djangorestframework/authenticators.py
View file @
5a59f339
...
@@ -68,7 +68,7 @@ class UserLoggedInAuthenticator(BaseAuthenticator):
...
@@ -68,7 +68,7 @@ class UserLoggedInAuthenticator(BaseAuthenticator):
if
request
.
method
.
upper
()
==
'POST'
:
if
request
.
method
.
upper
()
==
'POST'
:
# Temporarily replace request.POST with .RAW_CONTENT,
# Temporarily replace request.POST with .RAW_CONTENT,
# so that we use our more generic request parsing
# so that we use our more generic request parsing
request
.
_post
=
self
.
mixin
.
RAW_CONTENT
request
.
_post
=
self
.
view
.
RAW_CONTENT
resp
=
CsrfViewMiddleware
()
.
process_view
(
request
,
None
,
(),
{})
resp
=
CsrfViewMiddleware
()
.
process_view
(
request
,
None
,
(),
{})
del
(
request
.
_post
)
del
(
request
.
_post
)
if
resp
is
not
None
:
# csrf failed
if
resp
is
not
None
:
# csrf failed
...
...
djangorestframework/emitters.py
View file @
5a59f339
...
@@ -9,8 +9,14 @@ from django.template import RequestContext, loader
...
@@ -9,8 +9,14 @@ from django.template import RequestContext, loader
from
django.utils
import
simplejson
as
json
from
django.utils
import
simplejson
as
json
from
django
import
forms
from
django
import
forms
from
decimal
import
Decimal
from
djangorestframework.utils
import
dict2xml
,
url_resolves
from
djangorestframework.markdownwrapper
import
apply_markdown
from
djangorestframework.breadcrumbs
import
get_breadcrumbs
from
djangorestframework.description
import
get_name
,
get_description
from
djangorestframework
import
status
from
decimal
import
Decimal
import
string
# TODO: Rename verbose to something more appropriate
# TODO: Rename verbose to something more appropriate
# TODO: Maybe None could be handled more cleanly. It'd be nice if it was handled by default,
# TODO: Maybe None could be handled more cleanly. It'd be nice if it was handled by default,
...
...
djangorestframework/resource.py
View file @
5a59f339
...
@@ -77,6 +77,7 @@ class Resource(RequestMixin, ResponseMixin, AuthMixin, View):
...
@@ -77,6 +77,7 @@ class Resource(RequestMixin, ResponseMixin, AuthMixin, View):
# all other authentication is CSRF exempt.
# all other authentication is CSRF exempt.
@csrf_exempt
@csrf_exempt
def
dispatch
(
self
,
request
,
*
args
,
**
kwargs
):
def
dispatch
(
self
,
request
,
*
args
,
**
kwargs
):
try
:
self
.
request
=
request
self
.
request
=
request
self
.
args
=
args
self
.
args
=
args
self
.
kwargs
=
kwargs
self
.
kwargs
=
kwargs
...
@@ -126,6 +127,9 @@ class Resource(RequestMixin, ResponseMixin, AuthMixin, View):
...
@@ -126,6 +127,9 @@ class Resource(RequestMixin, ResponseMixin, AuthMixin, View):
response
.
headers
[
'Vary'
]
=
'Authenticate, Accept'
response
.
headers
[
'Vary'
]
=
'Authenticate, Accept'
return
self
.
emit
(
response
)
return
self
.
emit
(
response
)
except
:
import
traceback
traceback
.
print_exc
()
examples/blogpost/tests.py
View file @
5a59f339
...
@@ -3,10 +3,7 @@
...
@@ -3,10 +3,7 @@
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.test
import
TestCase
from
django.test
import
TestCase
<<<<<<<
local
=======
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
>>>>>>>
other
from
django.utils
import
simplejson
as
json
from
django.utils
import
simplejson
as
json
from
djangorestframework.compat
import
RequestFactory
from
djangorestframework.compat
import
RequestFactory
...
@@ -170,10 +167,7 @@ class AllowedMethodsTests(TestCase):
...
@@ -170,10 +167,7 @@ class AllowedMethodsTests(TestCase):
#above testcases need to probably moved to the core
#above testcases need to probably moved to the core
<<<<<<<
local
=======
>>>>>>>
other
class
TestRotation
(
TestCase
):
class
TestRotation
(
TestCase
):
"""For the example the maximum amount of Blogposts is capped off at views.MAX_POSTS.
"""For the example the maximum amount of Blogposts is capped off at views.MAX_POSTS.
...
...
examples/pygments_api/tests.py
View file @
5a59f339
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.utils
import
simplejson
as
json
from
django.utils
import
simplejson
as
json
<<<<<<<
local
=======
>>>>>>>
other
from
djangorestframework.compat
import
RequestFactory
from
djangorestframework.compat
import
RequestFactory
from
pygments_api
import
views
from
pygments_api
import
views
import
tempfile
,
shutil
import
tempfile
,
shutil
<<<<<<<
local
=======
>>>>>>>
other
class
TestPygmentsExample
(
TestCase
):
class
TestPygmentsExample
(
TestCase
):
...
...
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