mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-08 06:14:47 +03:00
Merge bd482284f9
into 9b56dda918
This commit is contained in:
commit
47d31c9608
|
@ -49,10 +49,10 @@ class APIException(Exception):
|
||||||
default_detail = _('A server error occurred.')
|
default_detail = _('A server error occurred.')
|
||||||
|
|
||||||
def __init__(self, detail=None):
|
def __init__(self, detail=None):
|
||||||
if detail is not None:
|
if detail is None:
|
||||||
self.detail = force_text(detail)
|
|
||||||
else:
|
|
||||||
self.detail = force_text(self.default_detail)
|
self.detail = force_text(self.default_detail)
|
||||||
|
elif isinstance(detail, basestring):
|
||||||
|
self.detail = force_text(detail)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.detail
|
return self.detail
|
||||||
|
|
Loading…
Reference in New Issue
Block a user