-
Notifications
You must be signed in to change notification settings - Fork 31
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
[BUG?] post_publish Signal replacement arguments #414
Comments
@fsbraun any thoughts on this? (Sorry not sure if you're the right person to tag!) |
@Will-Hoey Fabian certainly is the right person to tag. Our expert in the majority of things these days. |
@Will-Hoey Sorry, I don't know why the signature changed. (Most of what I know is there's been a change to the signals here: #348). We need to assume that the current signal signatures are used. If there is a good reason to change it, we would need a deprecation period, during which both signatures work. That would require to send both |
@fsbraun Not a problem. We can work around this for now as we don't use it all that often. Thanks for the reply. |
As of CMS v4, the publish signals have been moved into versioning. In one of our projects we use
django-elasticsearch-dsl
in order to search on Title/PageContent objects. We used the signals to update the index on Page publish/unpublish.Which roughly translates to
However, there is a small difference in the way that the signals are sent
https://github.com/django-cms/django-cms/blob/release/3.11.x/cms/models/pagemodel.py#L1007 vs
djangocms-versioning/djangocms_versioning/operations.py
Line 40 in f31b5e0
The old way seems to adhere more to what libraries like Elasticsearch are expecting by sending
instance
as the arg rather than the newobj
.Happy to work around this if there are other reasons why this was changed, just curious if this was an intended decision?
Note:
Workaround this by overriding the
handle_save
method in the SignalProcessor fromdjango-elasticsearch-dsl
to account for either theinstance
orobj
arguments.The text was updated successfully, but these errors were encountered: