Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
4a246a02
Kaydet (Commit)
4a246a02
authored
Kas 16, 2016
tarafından
Vinay Karanam
Kaydeden (comit)
Tim Graham
Ara 07, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #17235 -- Made MultiPartParser leave request.POST immutable.
üst
183f5015
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
1 deletion
+26
-1
options.py
django/contrib/admin/options.py
+1
-1
admin.py
django/contrib/auth/admin.py
+1
-0
multipartparser.py
django/http/multipartparser.py
+1
-0
1.11.txt
docs/releases/1.11.txt
+4
-0
tests.py
tests/requests/tests.py
+19
-0
No files found.
django/contrib/admin/options.py
Dosyayı görüntüle @
4a246a02
...
...
@@ -1785,7 +1785,7 @@ class ModelAdmin(BaseModelAdmin):
}
if
request
.
method
==
'POST'
:
formset_params
.
update
({
'data'
:
request
.
POST
,
'data'
:
request
.
POST
.
copy
()
,
'files'
:
request
.
FILES
,
'save_as_new'
:
'_saveasnew'
in
request
.
POST
})
...
...
django/contrib/auth/admin.py
Dosyayı görüntüle @
4a246a02
...
...
@@ -205,6 +205,7 @@ class UserAdmin(admin.ModelAdmin):
# * The user has pressed the 'Save and add another' button
# * We are adding a user in a popup
if
'_addanother'
not
in
request
.
POST
and
IS_POPUP_VAR
not
in
request
.
POST
:
request
.
POST
=
request
.
POST
.
copy
()
request
.
POST
[
'_continue'
]
=
1
return
super
(
UserAdmin
,
self
)
.
response_add
(
request
,
obj
,
post_url_continue
)
django/http/multipartparser.py
Dosyayı görüntüle @
4a246a02
...
...
@@ -289,6 +289,7 @@ class MultiPartParser(object):
if
retval
:
break
self
.
_post
.
_mutable
=
False
return
self
.
_post
,
self
.
_files
def
handle_file_complete
(
self
,
old_field_name
,
counters
):
...
...
docs/releases/1.11.txt
Dosyayı görüntüle @
4a246a02
...
...
@@ -634,6 +634,10 @@ Miscellaneous
* The undocumented ``django.utils.functional.lazy_property`` is removed.
* For consistency with non-multipart requests, ``MultiPartParser.parse()`` now
leaves ``request.POST`` immutable. If you're modifying that ``QueryDict``,
you must now first copy it, e.g. ``request.POST.copy()``.
.. _deprecated-features-1.11:
Features deprecated in 1.11
...
...
tests/requests/tests.py
Dosyayı görüntüle @
4a246a02
...
...
@@ -533,6 +533,25 @@ class RequestsTests(SimpleTestCase):
self
.
assertEqual
(
request
.
read
(
13
),
b
'--boundary
\r\n
C'
)
self
.
assertEqual
(
request
.
POST
,
{
'name'
:
[
'value'
]})
def
test_POST_immutable_for_mutipart
(
self
):
"""
MultiPartParser.parse() leaves request.POST immutable.
"""
payload
=
FakePayload
(
"
\r\n
"
.
join
([
'--boundary'
,
'Content-Disposition: form-data; name="name"'
,
''
,
'value'
,
'--boundary--'
,
]))
request
=
WSGIRequest
({
'REQUEST_METHOD'
:
'POST'
,
'CONTENT_TYPE'
:
'multipart/form-data; boundary=boundary'
,
'CONTENT_LENGTH'
:
len
(
payload
),
'wsgi.input'
:
payload
,
})
self
.
assertFalse
(
request
.
POST
.
_mutable
)
def
test_POST_connection_error
(
self
):
"""
If wsgi.input.read() raises an exception while trying to read() the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment