From d90d5380d730b992b1b59aaf9d1f89fbbbba0f9f Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 19 Dec 2012 22:05:00 +0000 Subject: [PATCH 1/3] pep8 --- rest_framework/tests/renderers.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rest_framework/tests/renderers.py b/rest_framework/tests/renderers.py index 9be4b1146..fb843676c 100644 --- a/rest_framework/tests/renderers.py +++ b/rest_framework/tests/renderers.py @@ -444,19 +444,19 @@ class CacheRenderTest(TestCase): return if state == None: return - if isinstance(state,tuple): - if not isinstance(state[0],dict): - state=state[1] + if isinstance(state, tuple): + if not isinstance(state[0], dict): + state = state[1] else: - state=state[0].update(state[1]) + state = state[0].update(state[1]) result = {} for i in state: try: - pickle.dumps(state[i],protocol=2) + pickle.dumps(state[i], protocol=2) except pickle.PicklingError: if not state[i] in seen: seen.append(state[i]) - result[i] = cls._get_pickling_errors(state[i],seen) + result[i] = cls._get_pickling_errors(state[i], seen) return result def http_resp(self, http_method, url): From 598ae3286ac6343a59e6d80fc93428539c5f836e Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 19 Dec 2012 22:05:35 +0000 Subject: [PATCH 2/3] Fix #521. (Browseable API exception on delete) --- rest_framework/mixins.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest_framework/mixins.py b/rest_framework/mixins.py index 8dc0c3295..2700606d0 100644 --- a/rest_framework/mixins.py +++ b/rest_framework/mixins.py @@ -124,6 +124,6 @@ class DestroyModelMixin(object): Should be mixed in with `SingleObjectBaseView`. """ def destroy(self, request, *args, **kwargs): - self.object = self.get_object() - self.object.delete() + obj = self.get_object() + obj.delete() return Response(status=status.HTTP_204_NO_CONTENT) From c29b08ad43c8de5f295176eaf0270427f3a737f3 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 19 Dec 2012 22:06:38 +0000 Subject: [PATCH 3/3] Update release notes --- docs/topics/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/topics/release-notes.md b/docs/topics/release-notes.md index 87aaefbdb..c75f08790 100644 --- a/docs/topics/release-notes.md +++ b/docs/topics/release-notes.md @@ -8,6 +8,7 @@ ### Master +* Bugfix: Fix exception in browseable API on DELETE. * Bugfix: Fix issue where pk was was being set to a string if set by URL kwarg. ### 2.1.11