From cfd4971b1bdb815371fbb736353f08674e51bbb6 Mon Sep 17 00:00:00 2001 From: Hamish Moffatt Date: Thu, 16 Feb 2023 12:55:04 +1100 Subject: [PATCH] Don't send custom parameters if empty in deep linking result --- pylti1p3/deep_link_resource.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pylti1p3/deep_link_resource.py b/pylti1p3/deep_link_resource.py index 131606f..0574f29 100644 --- a/pylti1p3/deep_link_resource.py +++ b/pylti1p3/deep_link_resource.py @@ -65,7 +65,6 @@ def to_dict(self) -> t.Dict[str, object]: "type": self._type, "title": self._title, "url": self._url, - "custom": self._custom_params, } if self._lineitem: line_item: t.Dict[str, object] = { @@ -93,4 +92,7 @@ def to_dict(self) -> t.Dict[str, object]: if self._icon_url: res["icon"] = {"url": self._icon_url} + if self._custom_params: + res["custom"] = self._custom_params + return res