mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-30 21:44:04 +03:00
ran the tests and made some corrections to the merging
This commit is contained in:
parent
59e6cd9892
commit
9dbe8b646e
|
@ -79,9 +79,9 @@ class BasicAuthentication(BaseAuthentication):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
username = encoding.smart_unicode(auth_parts[0])
|
username = smart_unicode(auth_parts[0])
|
||||||
password = encoding.smart_unicode(auth_parts[2])
|
password = smart_unicode(auth_parts[2])
|
||||||
except encoding.DjangoUnicodeDecodeError:
|
except DjangoUnicodeDecodeError:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
user = authenticate(username=username, password=password)
|
user = authenticate(username=username, password=password)
|
||||||
|
|
|
@ -126,8 +126,6 @@ class FormResource(Resource):
|
||||||
data = data and data or {}
|
data = data and data or {}
|
||||||
files = files and files or {}
|
files = files and files or {}
|
||||||
|
|
||||||
# In addition to regular validation we also ensure no additional fields
|
|
||||||
# are being passed in...
|
|
||||||
seen_fields_set = set(data.keys())
|
seen_fields_set = set(data.keys())
|
||||||
form_fields_set = set(bound_form.fields.keys())
|
form_fields_set = set(bound_form.fields.keys())
|
||||||
allowed_extra_fields_set = set(allowed_extra_fields)
|
allowed_extra_fields_set = set(allowed_extra_fields)
|
||||||
|
@ -142,7 +140,7 @@ class FormResource(Resource):
|
||||||
cleaned_data = bound_form.cleaned_data
|
cleaned_data = bound_form.cleaned_data
|
||||||
|
|
||||||
# Add in any extra fields to the cleaned content...
|
# Add in any extra fields to the cleaned content...
|
||||||
for key in (allowed_extra_fields & seen_fields) - set(cleaned_data.keys()):
|
for key in (allowed_extra_fields_set & seen_fields_set) - set(cleaned_data.keys()):
|
||||||
cleaned_data[key] = data[key]
|
cleaned_data[key] = data[key]
|
||||||
|
|
||||||
return cleaned_data
|
return cleaned_data
|
||||||
|
|
|
@ -157,7 +157,7 @@ class RendererIntegrationTests(TestCase):
|
||||||
|
|
||||||
_flat_repr = '{"foo": ["bar", "baz"]}'
|
_flat_repr = '{"foo": ["bar", "baz"]}'
|
||||||
|
|
||||||
_indented_repr = '{\n "foo": [\n "bar", \n "baz"\n ]\n}'
|
_indented_repr = '{\n "foo": [\n "bar",\n "baz"\n ]\n}'
|
||||||
|
|
||||||
|
|
||||||
class JSONRendererTests(TestCase):
|
class JSONRendererTests(TestCase):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user