resolve() should use relative_path to build media path

Bug #451747 reported by Ryan Kelly
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
django-staticmedia
Fix Released
High
tamask

Bug Description

The resolve() function searches for the media file using relative_path, but returns a path constructed using the original media_name. This can result in the returned media path using incorrect path separators on windows. I've modified my version to use this search loop:

    for mount_url, mount_path in get_mount_points():
        media_path = os.path.join(mount_path, relative_path)
        if os.path.lexists(media_path):
            return (
                posixpath.join(mount_url, media_name),
                media_path)

tamask (tamask)
Changed in django-staticmedia:
status: New → Triaged
importance: Undecided → High
assignee: nobody → tamask (tamask)
tamask (tamask)
Changed in django-staticmedia:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.