diff --git a/rest_framework/exceptions.py b/rest_framework/exceptions.py index 1f381e4ef..500c04583 100644 --- a/rest_framework/exceptions.py +++ b/rest_framework/exceptions.py @@ -39,10 +39,10 @@ class APIException(Exception): default_detail = _('A server error occured') def __init__(self, detail=None): - if detail is not None: - self.detail = force_text(detail) - else: + if detail is None: self.detail = force_text(self.default_detail) + elif isinstance(detail, basestring): + self.detail = force_text(detail) def __str__(self): return self.detail