Opened 6 years ago

Closed 6 years ago

#28603 closed Cleanup/optimization (fixed)

collectstatic passes all files to post_process(), contrary to code comment

Reported by: Ed Morley Owned by: Ed Morley
Component: contrib.staticfiles Version: dev
Severity: Normal Keywords: collectstatic
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


In the collectstatic's collect() function (source), there is this comment:

        # 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:

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 :-)

Change History (3)

comment:1 Changed 6 years ago by Ed Morley

Has patch: set
Owner: changed from nobody to Ed Morley
Status: newassigned

comment:2 Changed 6 years ago by Tim Graham

Triage Stage: UnreviewedReady for checkin

comment:3 Changed 6 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 2d4ccac:

Fixed #28603 -- Clarified comment in collectstatic's collect().

Note: See TracTickets for help on using tickets.
Back to Top