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
a7284cc0
Kaydet (Commit)
a7284cc0
authored
Eyl 27, 2018
tarafından
Tim Graham
Kaydeden (comit)
Carlton Gibson
Eki 01, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #29809 -- Fixed a crash when a "view only" user POSTs to the admin user change form.
üst
bf39978a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
forms.py
django/contrib/auth/forms.py
+1
-1
2.1.2.txt
docs/releases/2.1.2.txt
+3
-0
test_views.py
tests/auth_tests/test_views.py
+9
-0
No files found.
django/contrib/auth/forms.py
Dosyayı görüntüle @
a7284cc0
...
@@ -150,7 +150,7 @@ class UserChangeForm(forms.ModelForm):
...
@@ -150,7 +150,7 @@ class UserChangeForm(forms.ModelForm):
# Regardless of what the user provides, return the initial value.
# Regardless of what the user provides, return the initial value.
# This is done here, rather than on the field, because the
# This is done here, rather than on the field, because the
# field does not have access to the initial value
# field does not have access to the initial value
return
self
.
initial
[
"password"
]
return
self
.
initial
.
get
(
'password'
)
class
AuthenticationForm
(
forms
.
Form
):
class
AuthenticationForm
(
forms
.
Form
):
...
...
docs/releases/2.1.2.txt
Dosyayı görüntüle @
a7284cc0
...
@@ -35,3 +35,6 @@ Bugfixes
...
@@ -35,3 +35,6 @@ Bugfixes
* Fixed a regression where sliced queries with multiple columns with the same
* Fixed a regression where sliced queries with multiple columns with the same
name crashed on Oracle 12.1 (:ticket:`29630`).
name crashed on Oracle 12.1 (:ticket:`29630`).
* Fixed a crash when a user with the view (but not change) permission made a
POST request to an admin user change form (:ticket:`29809`).
tests/auth_tests/test_views.py
Dosyayı görüntüle @
a7284cc0
...
@@ -1221,6 +1221,7 @@ class ChangelistTests(AuthViewsTestCase):
...
@@ -1221,6 +1221,7 @@ class ChangelistTests(AuthViewsTestCase):
u
=
User
.
objects
.
get
(
username
=
'testclient'
)
u
=
User
.
objects
.
get
(
username
=
'testclient'
)
u
.
is_superuser
=
False
u
.
is_superuser
=
False
u
.
save
()
u
.
save
()
original_password
=
u
.
password
u
.
user_permissions
.
add
(
get_perm
(
User
,
'view_user'
))
u
.
user_permissions
.
add
(
get_perm
(
User
,
'view_user'
))
response
=
self
.
client
.
get
(
reverse
(
'auth_test_admin:auth_user_change'
,
args
=
(
u
.
pk
,)),)
response
=
self
.
client
.
get
(
reverse
(
'auth_test_admin:auth_user_change'
,
args
=
(
u
.
pk
,)),)
algo
,
salt
,
hash_string
=
(
u
.
password
.
split
(
'$'
))
algo
,
salt
,
hash_string
=
(
u
.
password
.
split
(
'$'
))
...
@@ -1235,6 +1236,14 @@ class ChangelistTests(AuthViewsTestCase):
...
@@ -1235,6 +1236,14 @@ class ChangelistTests(AuthViewsTestCase):
),
),
html
=
True
,
html
=
True
,
)
)
# Value in POST data is ignored.
data
=
self
.
get_user_data
(
u
)
data
[
'password'
]
=
'shouldnotchange'
change_url
=
reverse
(
'auth_test_admin:auth_user_change'
,
args
=
(
u
.
pk
,))
response
=
self
.
client
.
post
(
change_url
,
data
)
self
.
assertRedirects
(
response
,
reverse
(
'auth_test_admin:auth_user_changelist'
))
u
.
refresh_from_db
()
self
.
assertEqual
(
u
.
password
,
original_password
)
@override_settings
(
@override_settings
(
...
...
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