Urg. Fixing broken merge

This commit is contained in:
Tom Christie 2011-04-27 18:44:21 +01:00
parent b18302586c
commit 5a59f339c1
5 changed files with 59 additions and 61 deletions

View File

@ -68,7 +68,7 @@ class UserLoggedInAuthenticator(BaseAuthenticator):
if request.method.upper() == 'POST':
# Temporarily replace request.POST with .RAW_CONTENT,
# 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, (), {})
del(request._post)
if resp is not None: # csrf failed

View File

@ -9,8 +9,14 @@ from django.template import RequestContext, loader
from django.utils import simplejson as json
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: Maybe None could be handled more cleanly. It'd be nice if it was handled by default,

View File

@ -77,6 +77,7 @@ class Resource(RequestMixin, ResponseMixin, AuthMixin, View):
# all other authentication is CSRF exempt.
@csrf_exempt
def dispatch(self, request, *args, **kwargs):
try:
self.request = request
self.args = args
self.kwargs = kwargs
@ -126,6 +127,9 @@ class Resource(RequestMixin, ResponseMixin, AuthMixin, View):
response.headers['Vary'] = 'Authenticate, Accept'
return self.emit(response)
except:
import traceback
traceback.print_exc()

View File

@ -3,10 +3,7 @@
from django.core.urlresolvers import reverse
from django.test import TestCase
<<<<<<< local
=======
from django.core.urlresolvers import reverse
>>>>>>> other
from django.utils import simplejson as json
from djangorestframework.compat import RequestFactory
@ -170,10 +167,7 @@ class AllowedMethodsTests(TestCase):
#above testcases need to probably moved to the core
<<<<<<< local
=======
>>>>>>> other
class TestRotation(TestCase):
"""For the example the maximum amount of Blogposts is capped off at views.MAX_POSTS.

View File

@ -1,18 +1,12 @@
from django.test import TestCase
from django.utils import simplejson as json
<<<<<<< local
=======
>>>>>>> other
from djangorestframework.compat import RequestFactory
from pygments_api import views
import tempfile, shutil
<<<<<<< local
=======
>>>>>>> other
class TestPygmentsExample(TestCase):