lamby / django-slack

Slack integration for Django, using the templating engine to generate messages
https://django-slack.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
241 stars 57 forks source link

Can't override token per message #92

Closed oystein-beaufort closed 4 years ago

oystein-beaufort commented 4 years ago

According to the docs, you can override on a per-message level by specifying a {% block token %}{% endblock %} in your message templates. But when I try this, I get the following error: ValueError: token parameter is required if custom endpoint URL is not specified.

It seems slack_message does not look for a token override in the message template, as render is not specified for the token param in the slack_message method: https://github.com/lamby/django-slack/blob/ea71627729e9c325914181f25ce7507a37c42a35/django_slack/api.py render should be true for the token for it to be able to be overriden per message, right?

This looks to be the case for other params as well, e.g. icon_url, icon_emoji etc.

oystein-beaufort commented 4 years ago

Nevermind, I'm stupid. I mixed up context with kwargs when calling slack_message for some reason. This is a great package, keep up the good work! :)

lamby commented 4 years ago

:-)