diff options
| author | Jannis Leidel <jannis@leidel.info> | 2014-02-09 14:48:11 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2014-02-09 14:48:11 +0000 |
| commit | f90be002d9d3c10b87c74741986e2cbf9f2b858e (patch) | |
| tree | 4ed6b418bdfb0a3d52661395e4440a93cc25f1b1 /django | |
| parent | 6a9ed7d403a5f90a7c7354097aae99b74e8ce215 (diff) | |
Fixed #20780 -- Get rid of stale symlinks when using collectstatic.
Thanks to John Giannelos for the initial patch.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/staticfiles/management/commands/collectstatic.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/contrib/staticfiles/management/commands/collectstatic.py b/django/contrib/staticfiles/management/commands/collectstatic.py index 02e95d56b9..a820fed638 100644 --- a/django/contrib/staticfiles/management/commands/collectstatic.py +++ b/django/contrib/staticfiles/management/commands/collectstatic.py @@ -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 |
