mirror of https://github.com/zulip/zulip.git
logging_util: Save an assertion with __getitem__.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
parent
fc3de0ba41
commit
417e1b5e81
|
@ -255,11 +255,10 @@ class ZulipWebhookFormatter(ZulipFormatter):
|
|||
return super().format(record)
|
||||
|
||||
if request.content_type == "application/json":
|
||||
payload: Union[str, bytes, None] = request.body
|
||||
payload: Union[str, bytes] = request.body
|
||||
else:
|
||||
payload = request.POST.get("payload")
|
||||
payload = request.POST["payload"]
|
||||
|
||||
assert payload is not None
|
||||
try:
|
||||
payload = orjson.dumps(orjson.loads(payload), option=orjson.OPT_INDENT_2).decode()
|
||||
except orjson.JSONDecodeError:
|
||||
|
|
Loading…
Reference in New Issue