don't hardcode post parameters
This commit is contained in:
parent
fa8512789f
commit
25250f7c10
@ -49,11 +49,9 @@ class Webhook(RPC):
|
|||||||
if not valuedict:
|
if not valuedict:
|
||||||
logger.info("Message type %s not configured for webhooks", msg['type'])
|
logger.info("Message type %s not configured for webhooks", msg['type'])
|
||||||
return
|
return
|
||||||
|
payload = {}
|
||||||
payload = {"value1": valuedict.get('value1', '').format(**msg),
|
for k in valuedict:
|
||||||
"value2": valuedict.get('value2', '').format(**msg),
|
payload[k] = valuedict[k].format(**msg)
|
||||||
"value3": valuedict.get('value3', '').format(**msg)
|
|
||||||
}
|
|
||||||
|
|
||||||
self._send_msg(payload)
|
self._send_msg(payload)
|
||||||
except KeyError as exc:
|
except KeyError as exc:
|
||||||
|
Loading…
Reference in New Issue
Block a user