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
11e30b68
Kaydet (Commit)
11e30b68
authored
Nis 10, 2014
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed a KeyError on login with legacy sessions; refs #21649.
Thanks Loic for the report.
üst
ecff136f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
__init__.py
django/contrib/auth/__init__.py
+1
-1
test_views.py
django/contrib/auth/tests/test_views.py
+16
-0
No files found.
django/contrib/auth/__init__.py
Dosyayı görüntüle @
11e30b68
...
...
@@ -86,7 +86,7 @@ def login(request, user):
if
SESSION_KEY
in
request
.
session
:
if
request
.
session
[
SESSION_KEY
]
!=
user
.
pk
or
(
session_auth_hash
and
request
.
session
[
HASH_SESSION_KEY
]
!=
session_auth_hash
):
request
.
session
.
get
(
HASH_SESSION_KEY
)
!=
session_auth_hash
):
# To avoid reusing another user's session, create a new, empty
# session if the existing session corresponds to a different
# authenticated user.
...
...
django/contrib/auth/tests/test_views.py
Dosyayı görüntüle @
11e30b68
...
...
@@ -594,6 +594,22 @@ class LoginTest(AuthViewsTestCase):
self
.
login
(
password
=
'foobar'
)
self
.
assertNotEqual
(
original_session_key
,
self
.
client
.
session
.
session_key
)
def
test_login_session_without_hash_session_key
(
self
):
"""
Session without django.contrib.auth.HASH_SESSION_KEY should login
without an exception.
"""
user
=
User
.
objects
.
get
(
username
=
'testclient'
)
engine
=
import_module
(
settings
.
SESSION_ENGINE
)
session
=
engine
.
SessionStore
()
session
[
SESSION_KEY
]
=
user
.
id
session
.
save
()
original_session_key
=
session
.
session_key
self
.
client
.
cookies
[
settings
.
SESSION_COOKIE_NAME
]
=
original_session_key
self
.
login
()
self
.
assertNotEqual
(
original_session_key
,
self
.
client
.
session
.
session_key
)
@skipIfCustomUser
class
LoginURLSettings
(
AuthViewsTestCase
):
...
...
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