[branch product-model-refactor] User cannot add 'default image' in admin

Issue #77 resolved
Former user created an issue

After reviewing the fix for Ticket #76, I noticed that a user (via the Admin) cannot add a default image. The definition of a default image an image entry in the product_productimage table, where the product foreign key is null. The admin requires a Product to be chosen.

The fix is simple, in product-model-refactor/satchmo/product/models.py, line 596:

Original Line: product = models.ForeignKey(Product, edit_inline=models.TABULAR, num_in_admin=3, null=True)

New Line: product = models.ForeignKey(Product, edit_inline=models.TABULAR, num_in_admin=3, null=True, blank=True)

Setting blank=True, tells the admin that Product is NOT required. The user can now enter a default image using the legacy Product Images view in admin.

Reported by markph

Comments (1)

  1. Log in to comment