Skip to content

Add "exists" method to StaticManifestMixin#14

Open
ryanbagwell wants to merge 2 commits intohzdg:masterfrom
ryanbagwell:master
Open

Add "exists" method to StaticManifestMixin#14
ryanbagwell wants to merge 2 commits intohzdg:masterfrom
ryanbagwell:master

Conversation

@ryanbagwell
Copy link

so it checks the remote storage for the name of the remotely stored file instead of the locally stored file.

matthewwithanm and others added 2 commits November 19, 2013 15:03
…with the proposed storage name exists instead of the local storage name
@matthewwithanm
Copy link
Contributor

I'm not 100% clear on what this is for, but I think this might be conflating what the storage object is calling "names" and URLs, which don't necessarily correspond to the names used by other storage objects.

Also, the job of the StaticManifestMixin is super-limited: it's just supposed to look up URLs using the static manifest, so if it has an exists() method, it should probably be very similar to url():

def exists(self, name):
    if not settings.ECSTATIC_USE_MANIFEST:
        return super(StaticManifestMixin, self).exists(name)
    try:
        staticfiles_manifest.get(name)
        return True
    except NotInManifest:
        return False

I think this would accomplish what you want, but we'll have to test it a bunch before merging to make sure nothing else is depending on the underlying exists method.

@ryanbagwell
Copy link
Author

I see what you're saying, but that only checks if the file is listed in the manifest, not that it actually exists on the remote storage object. I think you still want to call super(StaticManifestMixin, self).url(name) after getting the name listed in the manifest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants