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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user