Warning: default category image not found - try syncdb

Issue #677 resolved
Former user created an issue

when a category doesn't have an image it should return a default image.

Instead it tries to get CategoryImage.objects.filter(category__isnull=True).order_by('sort')[0]

which is null (it's impossible to add a CategoryImage for category null in admin)

Reported by aronchi

Comments (4)

  1. Former user Account Deleted

    I solved with:

    insert into product_categoryimage (picture,caption,sort) values ('images/productimage-picture-default.jpg','Photo Not Available', 1)

    but I think it should be in fixtures at installation, and maybe a setting value instead of a db line).

  2. Hynek Cernoch

    This have been fixed by Chris in 77d629edff95 .

    Yes, the message "try syncdb" is nonsense because if a table does not exists, it would not use this exception and this message. It Should be fixed. I fixed it in a patch of cumulative unimportant changes which is comming.

  3. Hynek Cernoch
    • changed status to open

    The patch #77d629edff95 should be improved, because satchmo_utils.thumbnail.field.ImageWithThumbnailField renames image for CategoryImage to categoryimage-picture-%(slug)s.jpg (slug='default'). If for both default category image and product image is used the same image, the former is removed

  4. Log in to comment