don't hardcode post parameters

This commit is contained in:
Matthias 2018-07-07 13:38:06 +02:00
parent fa8512789f
commit 25250f7c10

View File

@ -49,11 +49,9 @@ class Webhook(RPC):
if not valuedict:
logger.info("Message type %s not configured for webhooks", msg['type'])
return
payload = {"value1": valuedict.get('value1', '').format(**msg),
"value2": valuedict.get('value2', '').format(**msg),
"value3": valuedict.get('value3', '').format(**msg)
}
payload = {}
for k in valuedict:
payload[k] = valuedict[k].format(**msg)
self._send_msg(payload)
except KeyError as exc: