#27658: collectstatic overwrites newer files in remote storage
-------------------------------------+-------------------------------------
     Reporter:  Paolo Dente          |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  contrib.staticfiles  |                  Version:  1.10
     Severity:  Normal               |               Resolution:
     Keywords:  staticfiles          |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Old description:

> @Tim: as far as I can tell, any non-local storage should be affected so a
> possible test would require mocking Storage or the management command so
> that Command.local() is False; I can try and write one. On the other
> hand, it looks like @Vitali spotted the problem with the refactoring, so
> I don't know how to proceed from here.

New description:

 The change to
 django/contrib/staticfiles/management/commands/collectstatic.py in commit
 2cd2d188516475ddf256e6267cd82c495fb5c430 causes the command to overwrite
 all static files in remote storage (eg. S3), instead of only updatable
 ones.

 A quick workaround is to override the command and restore the previous
 Command.delete_file() in the subclass, but I suppose this should be fixed.

--

Comment (by Paolo Dente):

 @Tim: as far as I can tell, any non-local storage should be affected so a
 possible test would require mocking Storage or the management command so
 that Command.local() is False; I can try and write one. On the other hand,
 it looks like @Vitali spotted the problem with the refactoring, so I don't
 know how to proceed from here.

--
Ticket URL: <https://code.djangoproject.com/ticket/27658#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.70db86cd7f4eec613439cb9089b5202b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to