Closed skleinfeldt closed 6 years ago
@skleinfeldt I have mentioned this issue long back to @datakurre. But then we decided to let @tkimnguyen to take a call on it, whether we should suppress it or not?
That's good that you noticed and discussed this. I think it's safe for me to make the call for @tkimnguyen - this message is just confusing for people who don't know (or want to know) anything about content rules, so it should be suppressed.
I assume that queued status messages can be cleared with
from Products.statusmessages.interfaces import IStatusMessage
IStatusMessage(self.request).show()
@datakurre this method removes all the messages, even the ones which are added after it is being called.
I don’t understand how it could remove messages added after call :/
Yes, I too don't understand the magic. But that's happening. I called it just after the creation of the content rule. https://github.com/collective/collective.ifttt/blob/3ea56fff523eea0ede62d674340496ac661c3f8e/src/collective/ifttt/utils.py#L63
I believe they are stored as an annotation on the request. You could be able to delete those manually by following https://github.com/plone/Products.statusmessages/blob/master/Products/statusmessages/adapter.py
just use IAnnotations(self.request) and the the storage key constant
When I successfully add an IFTTT Content Trigger I get a successful info message from c.ifttt, plus a misleading info message from content rules:
Can the content rules message be suppressed?