stash-box icon indicating copy to clipboard operation
stash-box copied to clipboard

[Bug Report] Bad behaviour when image backend or image location not specified

Open WithoutPants opened this issue 2 years ago • 0 comments

Describe the bug

If image_backend is not specified, it silently defaults to file. If image_location is not specified, the system still allows images to be created in the database, and it places the image files in the current working directory. If you try to retrieve an image, you then get an error message indicating that the image location has not been specified.

On a related note, there's currently no means to delete images for drafts that were never actually submitted. If a user abandons a draft after adding one or more images and without submitting the draft, then these orphan images are left in the database. There also appears to be no way to remove images that are missing their related file in the filesystem.

To Reproduce Steps to reproduce the behavior:

  1. Configure a system without specifying the image_backend or image_location fields.
  2. Create a new performer draft, adding and uploading images. These operations are apparently successful.
  3. The images will show as present but broken in the UI - the requests return 400 indicating that the image location is not specified.

Expected behavior Either the image_location field should be validated at start up, or it should be validated when uploading an image. A UI error message should be shown if image upload fails.

WithoutPants avatar May 26 '23 01:05 WithoutPants