aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Christie2014-11-10 20:04:34 +0000
committerTom Christie2014-11-10 20:04:34 +0000
commit3e8068757b42d37623b915f6bc9bc5c162bd94c0 (patch)
treebeb3938d61e4a7baf67b7147c084f271d43b41e3
parent62ce653c61bb596f7fca99db86280c497c71b7ac (diff)
parent9521b697110f35187669e501c4fb89036c73c640 (diff)
downloaddjango-rest-framework-3e8068757b42d37623b915f6bc9bc5c162bd94c0.tar.bz2
Merge pull request #2055 from kevinlondon/patch-6
#2054: Update exceptions to allow custom detail
-rw-r--r--rest_framework/exceptions.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/rest_framework/exceptions.py b/rest_framework/exceptions.py
index 388d3dee..0b06d6e6 100644
--- a/rest_framework/exceptions.py
+++ b/rest_framework/exceptions.py
@@ -70,7 +70,7 @@ class MethodNotAllowed(APIException):
default_detail = "Method '%s' not allowed."
def __init__(self, method, detail=None):
- self.detail = (detail or self.default_detail) % method
+ self.detail = detail or (self.default_detail % method)
class NotAcceptable(APIException):
@@ -87,7 +87,7 @@ class UnsupportedMediaType(APIException):
default_detail = "Unsupported media type '%s' in request."
def __init__(self, media_type, detail=None):
- self.detail = (detail or self.default_detail) % media_type
+ self.detail = detail or (self.default_detail % media_type)
class Throttled(APIException):