#28603: collectstatic passes all files to post_process(), contrary to code 
comment
-------------------------------------+-------------------------------------
               Reporter:  Ed Morley  |          Owner:  nobody
                   Type:             |         Status:  new
  Cleanup/optimization               |
              Component:             |        Version:  master
  contrib.staticfiles                |
               Severity:  Normal     |       Keywords:  collectstatic
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 In the collectstatic's `collect()` function
 
([https://github.com/django/django/blob/8f947730ca6a9e3e538a377e7993e17ce3663ee6/django/contrib/staticfiles/management/commands/collectstatic.py#L124-L125
 source]), there is this comment:

 {{{#!python
         # Here we check if the storage backend has a post_process
         # method and pass it the list of modified files.
 }}}

 However contrary to that comment,`post_process()` is actually passed the
 list of all found files, not just the modified files:
 
https://github.com/django/django/blob/8f947730ca6a9e3e538a377e7993e17ce3663ee6/django/contrib/staticfiles/management/commands/collectstatic.py#L127

 I'm pretty passing all files is necessary, since if only the modified
 files were passed and someone had changed the storage backend since the
 last collectstatic run, then the existing files wouldn't have the
 necessary post processing applied.

 As such, I believe it's the comment that's wrong rather than the
 implementation, but it would be good to have confirmation :-)

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28603>
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/051.5b0a09d2917a5f468289041551083bd8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to