lhelkkul/PhotoAlbum — Issue #33: Replacing an image on a page with a new one doesn't work properly (see description).
Author: mrGroove
Created: 2012-02-22 10:24:31+00:00
State: open

There is a problem, however, which I tried to fix without success so far: When an existing image is to be replaced, at least on Windows systems the existing image cannot be deleted because it is "used by another process" at the moment (WindowsError 32). Only during a next request caused by reloading the page will the deletion be successful when performed with the ImageField's own delete() method. However, current code tries to save the name of the image and delete the image after loading the new one into the ImageField, which causes the old file not to be deleted at all, because the name of the file gets lost between requests.