|
14 | 14 | from django.http.multipartparser import parse_header
|
15 | 15 | from django.utils import six
|
16 | 16 | from django.utils.datastructures import MultiValueDict
|
17 |
| -from django.utils.datastructures import MergeDict as DjangoMergeDict |
18 | 17 | from rest_framework import HTTP_HEADER_ENCODING
|
19 | 18 | from rest_framework import exceptions
|
20 | 19 | from rest_framework.settings import api_settings
|
@@ -61,15 +60,6 @@ def __exit__(self, *args, **kwarg):
|
61 | 60 | self.view.action = self.action
|
62 | 61 |
|
63 | 62 |
|
64 |
| -class MergeDict(DjangoMergeDict, dict): |
65 |
| - """ |
66 |
| - Using this as a workaround until the parsers API is properly |
67 |
| - addressed in 3.1. |
68 |
| - """ |
69 |
| - def __init__(self, *dicts): |
70 |
| - self.dicts = dicts |
71 |
| - |
72 |
| - |
73 | 63 | class Empty(object):
|
74 | 64 | """
|
75 | 65 | Placeholder for unset attributes.
|
@@ -328,7 +318,8 @@ def _load_data_and_files(self):
|
328 | 318 | if not _hasattr(self, '_data'):
|
329 | 319 | self._data, self._files = self._parse()
|
330 | 320 | if self._files:
|
331 |
| - self._full_data = MergeDict(self._data, self._files) |
| 321 | + self._full_data = self._data.copy() |
| 322 | + self._full_data.update(self._files) |
332 | 323 | else:
|
333 | 324 | self._full_data = self._data
|
334 | 325 |
|
@@ -392,7 +383,8 @@ def _perform_form_overloading(self):
|
392 | 383 | # At this point we're committed to parsing the request as form data.
|
393 | 384 | self._data = self._request.POST
|
394 | 385 | self._files = self._request.FILES
|
395 |
| - self._full_data = MergeDict(self._data, self._files) |
| 386 | + self._full_data = self._data.copy() |
| 387 | + self._full_data.update(self._files) |
396 | 388 |
|
397 | 389 | # Method overloading - change the method and remove the param from the content.
|
398 | 390 | if (
|
|
0 commit comments