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
f90be002
Kaydet (Commit)
f90be002
authored
Şub 09, 2014
tarafından
Jannis Leidel
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #20780 -- Get rid of stale symlinks when using collectstatic.
Thanks to John Giannelos for the initial patch.
üst
6a9ed7d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
collectstatic.py
.../contrib/staticfiles/management/commands/collectstatic.py
+2
-0
tests.py
tests/staticfiles_tests/tests.py
+9
-0
No files found.
django/contrib/staticfiles/management/commands/collectstatic.py
Dosyayı görüntüle @
f90be002
...
...
@@ -275,6 +275,8 @@ class Command(NoArgsCommand):
except
OSError
:
pass
try
:
if
os
.
path
.
lexists
(
full_path
):
os
.
unlink
(
full_path
)
os
.
symlink
(
source_path
,
full_path
)
except
AttributeError
:
import
platform
...
...
tests/staticfiles_tests/tests.py
Dosyayı görüntüle @
f90be002
...
...
@@ -694,6 +694,15 @@ class TestCollectionLinks(CollectionTestCase, TestDefaults):
"""
self
.
assertTrue
(
os
.
path
.
islink
(
os
.
path
.
join
(
settings
.
STATIC_ROOT
,
'test.txt'
)))
def
test_broken_symlink
(
self
):
"""
Test broken symlink gets deleted.
"""
path
=
os
.
path
.
join
(
settings
.
STATIC_ROOT
,
'test.txt'
)
os
.
unlink
(
path
)
self
.
run_collectstatic
()
self
.
assertTrue
(
os
.
path
.
islink
(
path
))
class
TestServeStatic
(
StaticFilesTestCase
):
"""
...
...
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