-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Add versatile image field prewarmer #1947
Add versatile image field prewarmer #1947
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1947 +/- ##
==========================================
- Coverage 84.74% 84.73% -0.02%
==========================================
Files 161 162 +1
Lines 6911 6942 +31
Branches 701 705 +4
==========================================
+ Hits 5857 5882 +25
- Misses 863 866 +3
- Partials 191 194 +3
Continue to review full report at Codecov.
|
530ad00
to
219c00c
Compare
It would probably be useful to also create a command for |
@NyanKiyoshi Thought of the same thing, it will be definitely added. |
b9a3b51
to
4604649
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very good. We also have to add a section in the documentation explaining how this works and how to use it.
6e7b4f0
to
283a720
Compare
saleor/product/models.py
Outdated
@@ -392,6 +393,15 @@ def delete(self, *args, **kwargs): | |||
super().delete(*args, **kwargs) | |||
|
|||
|
|||
@receiver(models.signals.post_delete, sender=ProductImage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way not to use signals to implement this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should cover all places where ProductImage or its parent can be deleted.
Eg. Category/Product/ProductImage delete actions
Plus something can be always deleted from the shell (edge case,but still, most likely during development phase)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we currently delete the main image? If so, does it also rely on signals? If not, do we want to remove thumbnails?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use signals at all, except for one that comes from django-payments
if I'm correct. Also, we should care about cases when someone does changes using shell.
1466233
to
a8115c4
Compare
This pull requests add versatile image field prewarmer for product images.
close #1436
Pull Request Checklist
(Please keep this section. It will make maintainer's life easier.)
pycodestyle
,pydocstyle
,pylint
.eslint
.