diff options
Diffstat (limited to 'rest_framework')
| -rw-r--r-- | rest_framework/exceptions.py | 4 | ||||
| -rw-r--r-- | rest_framework/fields.py | 2 | ||||
| -rw-r--r-- | rest_framework/utils/html.py | 4 |
3 files changed, 5 insertions, 5 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): diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 4933d8db..58482db5 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -1106,7 +1106,7 @@ class HiddenField(Field): A hidden field does not take input from the user, or present any output, but it does populate a field in `validated_data`, based on its default value. This is particularly useful when we have a `unique_for_date` - constrain on a pair of fields, as we need some way to include the date in + constraint on a pair of fields, as we need some way to include the date in the validated data. """ def __init__(self, **kwargs): diff --git a/rest_framework/utils/html.py b/rest_framework/utils/html.py index 15e83b3b..d773952d 100644 --- a/rest_framework/utils/html.py +++ b/rest_framework/utils/html.py @@ -36,7 +36,7 @@ def parse_html_list(dictionary, prefix=''): '[0]foo': 'abc', '[0]bar': 'def', '[1]foo': 'hij', - '[2]bar': 'klm', + '[1]bar': 'klm', } --> [ @@ -72,7 +72,7 @@ def parse_html_dict(dictionary, prefix): --> { 'profile': { - 'username': 'example, + 'username': 'example', 'email': 'example@example.com' } } |
