Commit a7006fcd authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

webhook: send whole message, for genericity

parent 3d3b0cf5
......@@ -8,10 +8,11 @@ def send_moderator_webhook(contrib, request=None):
"""
if settings.WEBHOOK:
import requests
text = "Nouvelle demande de %s" % contrib.name
if request is not None:
text += ": %s" % contrib.get_absolute_url(request)
requests.post(
settings.WEBHOOK_URL,
data=json.dumps({
'name': contrib.name,
'permalink': contrib.get_absolute_url(request) if request else None,
settings.WEBHOOK_URL, data=json.dumps({
'text': text,
'key': settings.WEBHOOK_KEY,
}))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment