1👍
✅
It should be self.request
and not request
.
messages.add_message(self.request, message.ERROR, "...")
Source:stackexchange.com