mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-07 22:04:48 +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.')
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user