From c50637287b18ca00a54c6158f3edbb0136c71b16 Mon Sep 17 00:00:00 2001 From: Mason Tang Date: Wed, 24 Aug 2011 07:49:16 -0300 Subject: [PATCH 1/4] Fix in permissions, user.is_staff is a field, not a function. --- djangorestframework/permissions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/djangorestframework/permissions.py b/djangorestframework/permissions.py index 59c5f481f..0052a6094 100644 --- a/djangorestframework/permissions.py +++ b/djangorestframework/permissions.py @@ -73,7 +73,7 @@ class IsAdminUser(BasePermission): """ def check_permission(self, user): - if not user.is_staff(): + if not user.is_staff: raise _403_FORBIDDEN_RESPONSE From 249eb6f931e88e06339dbb5cdbd3e82630f20c0d Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Thu, 29 Sep 2011 19:47:20 +0200 Subject: [PATCH 2/4] Make sure to check for "is not None" so that depth=0 gets assigned properly. Thanks thomasst. --- djangorestframework/serializer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/djangorestframework/serializer.py b/djangorestframework/serializer.py index 22efa5ed3..55b84df16 100644 --- a/djangorestframework/serializer.py +++ b/djangorestframework/serializer.py @@ -106,7 +106,8 @@ class Serializer(object): def __init__(self, depth=None, stack=[], **kwargs): - self.depth = depth or self.depth + if depth is not None: + self.depth = depth self.stack = stack From 36b41aebb389d36d2bf82c8c471fad8d70b3a998 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Thu, 29 Sep 2011 19:48:25 +0200 Subject: [PATCH 3/4] Edited AUTHORS via GitHub --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 2b8af2b97..4c3cf2289 100644 --- a/AUTHORS +++ b/AUTHORS @@ -17,6 +17,7 @@ Garcia Solero Tom Drummond Danilo Bargen Andrew McCloud + THANKS TO: From 2caf879f22c013e9d29e1cd78e77bb6578bc0ee3 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 30 Sep 2011 14:16:25 +0200 Subject: [PATCH 4/4] Edited AUTHORS via GitHub --- AUTHORS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 4c3cf2289..22b12ba9a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -17,7 +17,7 @@ Garcia Solero Tom Drummond Danilo Bargen Andrew McCloud - +Thomas Steinacher THANKS TO: