1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #20780 -- Get rid of stale symlinks when using collectstatic.

Thanks to John Giannelos for the initial patch.
This commit is contained in:
Jannis Leidel
2014-02-09 14:48:11 +00:00
parent 6a9ed7d403
commit f90be002d9
2 changed files with 11 additions and 0 deletions

View File

@@ -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