diff --git a/AUTHORS b/AUTHORS index 2b8af2b97..22b12ba9a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -17,6 +17,7 @@ Garcia Solero Tom Drummond Danilo Bargen Andrew McCloud +Thomas Steinacher THANKS TO: 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 diff --git a/djangorestframework/serializer.py b/djangorestframework/serializer.py index 6803cb74c..582de70a1 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