mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #27658 -- Prevented collectstatic from overwriting newer files in remote storages.
Thanks revimi for the initial patch.
This commit is contained in:
parent
f60d4e704d
commit
c85831e4b7
5 changed files with 46 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
|||
import errno
|
||||
import os
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.staticfiles.storage import CachedStaticFilesStorage
|
||||
|
@ -59,6 +59,14 @@ class PathNotImplementedStorage(storage.Storage):
|
|||
raise NotImplementedError
|
||||
|
||||
|
||||
class NeverCopyRemoteStorage(PathNotImplementedStorage):
|
||||
"""
|
||||
Return a future modified time for all files so that nothing is collected.
|
||||
"""
|
||||
def get_modified_time(self, name):
|
||||
return datetime.now() + timedelta(days=30)
|
||||
|
||||
|
||||
class QueryStringStorage(storage.Storage):
|
||||
def url(self, path):
|
||||
return path + '?a=b&c=d'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue