Changes between Initial Version and Version 1 of Ticket #31520, comment 3


Ignore:
Timestamp:
Apr 28, 2020, 12:59:04 PM (5 years ago)
Author:
thenewguy

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31520, comment 3

    initial v1  
    11Two things - maybe a different issue, but shouldn't we log an ERROR or at least WARNING that the file was missing from the manifest so that it can be handled?  Since we would be hashing the files on every call it isn't free.  TBH I think it probably makes more sense here not to hash at all and just return the unmodified name plus the error/warning message?
     2
     3Edit:
     4
     5The docs seem to indicate the behavior should be as I've described: This behavior can be disabled by subclassing ManifestStaticFilesStorage and setting the manifest_strict attribute to False – nonexistent paths will remain unchanged. (https://docs.djangoproject.com/en/3.0/ref/contrib/staticfiles/#manifeststaticfilesstorage)
     6
     7Replacing
     8
     9{{{
     10            try:
     11                hashed = self.hashed_name(name)
     12            except ValueError:
     13                hashed = name
     14            cache_name = self.clean_name(hashed)
     15}}}
     16
     17with
     18
     19{{{
     20            cache_name = self.clean_name(name)
     21}}}
     22
     23would behave as currently documented and seems like the better way to handle it.  In addition to adding log output at the ERROR level.
Back to Top