use dict comprehension
This commit is contained in:
parent
6336d8a0e2
commit
120fc29643
@ -49,10 +49,8 @@ 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 = {}
|
|
||||||
for k in valuedict:
|
|
||||||
payload[k] = valuedict[k].format(**msg)
|
|
||||||
|
|
||||||
|
payload = {key: value.format(**msg) for (key, value) in valuedict.items()}
|
||||||
self._send_msg(payload)
|
self._send_msg(payload)
|
||||||
except KeyError as exc:
|
except KeyError as exc:
|
||||||
logger.exception("Problem calling Webhook. Please check your webhook configuration. "
|
logger.exception("Problem calling Webhook. Please check your webhook configuration. "
|
||||||
|
Loading…
Reference in New Issue
Block a user