Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crop area is not recorded on object creation in Django Admin for Proxy models #181

Open
agsimmons opened this issue Dec 2, 2022 · 0 comments

Comments

@agsimmons
Copy link

agsimmons commented Dec 2, 2022

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

  1. Clone repository
  2. Create virtual environment
  3. Install packages in requirements.txt
  4. Apply migrations
  5. Create superuser account
  6. Run the development server
  7. Log in to admin interface at 127.0.0.1:8000/admin/
  8. Create an example model instance. Provide a name and image. Press Save.
  9. Observe in the list view that the Image Cropping field has a value set.
  10. Create an example proxy model instance. Provide a name and image. Press Save.
  11. Observe in the list view that the Image Cropping field does not have a value set.
  12. Select the proxy model instance that you just created. Press Save.
  13. Observe in the list view that the Image Cropping field now has a value set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant