Hi!
I've noticed that if you create a proxy model that has an ImageField and an ImageRatio field, the crop field's value is not set upon saving for the first time. For non-proxy models, the crop field's value is set.
I've confirmed that if the object has already been created, then the image is added, the crop value is set upon save.
Django version tested: 3.2.16
Python version tested: 3.10
django-image-cropping version tested: 1.7
I've set up https://github.com/agsimmons/django-image-cropping-proxy-bug to demonstrate the bug
Steps to reproduce with the above repository
- Clone repository
- Create virtual environment
- Install packages in requirements.txt
- Apply migrations
- Create superuser account
- Run the development server
- Log in to admin interface at 127.0.0.1:8000/admin/
- Create an example model instance. Provide a name and image. Press Save.
- Observe in the list view that the Image Cropping field has a value set.
- Create an example proxy model instance. Provide a name and image. Press Save.
- Observe in the list view that the Image Cropping field does not have a value set.
- Select the proxy model instance that you just created. Press Save.
- Observe in the list view that the Image Cropping field now has a value set.
Hi!
I've noticed that if you create a proxy model that has an ImageField and an ImageRatio field, the crop field's value is not set upon saving for the first time. For non-proxy models, the crop field's value is set.
I've confirmed that if the object has already been created, then the image is added, the crop value is set upon save.
Django version tested: 3.2.16
Python version tested: 3.10
django-image-cropping version tested: 1.7
I've set up https://github.com/agsimmons/django-image-cropping-proxy-bug to demonstrate the bug
Steps to reproduce with the above repository