We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 62ce653 + 9521b69 commit 3e80687Copy full SHA for 3e80687
rest_framework/exceptions.py
@@ -70,7 +70,7 @@ class MethodNotAllowed(APIException):
70
default_detail = "Method '%s' not allowed."
71
72
def __init__(self, method, detail=None):
73
- self.detail = (detail or self.default_detail) % method
+ self.detail = detail or (self.default_detail % method)
74
75
76
class NotAcceptable(APIException):
@@ -87,7 +87,7 @@ class UnsupportedMediaType(APIException):
87
default_detail = "Unsupported media type '%s' in request."
88
89
def __init__(self, media_type, detail=None):
90
- self.detail = (detail or self.default_detail) % media_type
+ self.detail = detail or (self.default_detail % media_type)
91
92
93
class Throttled(APIException):
0 commit comments