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
687d2e96
Kaydet (Commit)
687d2e96
authored
Şub 23, 2013
tarafından
Lennart Regebro
Kaydeden (comit)
Claude Paroz
Şub 23, 2013
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #19827 -- Kept stacktrace in defaulttags exception reraising
Thanks Kronuz for the report and the initial patch.
üst
0ad76843
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
defaulttags.py
django/template/defaulttags.py
+4
-3
tests.py
tests/regressiontests/templates/tests.py
+16
-0
No files found.
django/template/defaulttags.py
Dosyayı görüntüle @
687d2e96
...
...
@@ -416,7 +416,8 @@ class URLNode(Node):
url
=
''
try
:
url
=
reverse
(
view_name
,
args
=
args
,
kwargs
=
kwargs
,
current_app
=
context
.
current_app
)
except
NoReverseMatch
as
e
:
except
NoReverseMatch
:
exc_info
=
sys
.
exc_info
()
if
settings
.
SETTINGS_MODULE
:
project_name
=
settings
.
SETTINGS_MODULE
.
split
(
'.'
)[
0
]
try
:
...
...
@@ -428,10 +429,10 @@ class URLNode(Node):
# Re-raise the original exception, not the one with
# the path relative to the project. This makes a
# better error message.
raise
e
six
.
reraise
(
*
exc_info
)
else
:
if
self
.
asvar
is
None
:
raise
e
raise
if
self
.
asvar
:
context
[
self
.
asvar
]
=
url
...
...
tests/regressiontests/templates/tests.py
Dosyayı görüntüle @
687d2e96
...
...
@@ -372,6 +372,22 @@ class Templates(TestCase):
with
self
.
assertRaises
(
urlresolvers
.
NoReverseMatch
):
t
.
render
(
c
)
@override_settings
(
TEMPLATE_STRING_IF_INVALID
=
'
%
s is invalid'
,
SETTINGS_MODULE
=
'also_something'
)
def
test_url_reverse_view_name
(
self
):
# Regression test for #19827
t
=
Template
(
'{
%
url will_not_match
%
}'
)
c
=
Context
()
try
:
t
.
render
(
c
)
except
urlresolvers
.
NoReverseMatch
:
tb
=
sys
.
exc_info
()[
2
]
depth
=
0
while
tb
.
tb_next
is
not
None
:
tb
=
tb
.
tb_next
depth
+=
1
self
.
assertTrue
(
depth
>
5
,
"The traceback context was lost when reraising the traceback. See #19827"
)
def
test_url_explicit_exception_for_old_syntax_at_run_time
(
self
):
# Regression test for #19280
t
=
Template
(
'{
%
url path.to.view
%
}'
)
# not quoted = old syntax
...
...
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