Skip to content

Commit 1341c95

Browse files
committed
pushExt 属性添加类型校验
1 parent e62d3c9 commit 1341c95

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

rongcloud/message.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@ def send(self, from_user_id, to_group_id, object_name, content, push_content=Non
356356
'{% if (is_include_sender != 0) %}&isIncludeSender={{ is_include_sender }}{% endif %}' \
357357
'{% if (is_mentioned != 0) %}&isMentioned={{ is_mentioned }}{% endif %}' \
358358
'{% if (content_available != 0) %}&contentAvailable={{ content_available }}{% endif %}' \
359-
'{% if (expansion != 0) %}&expansion={{ expansion }}{% endif %}' \
360-
'{% if (disable_push != 0) %}&disablePush={{ disable_push }}{% endif %}' \
359+
'{% if (expansion != False) %}&expansion={{ expansion }}{% endif %}' \
360+
'{% if (disable_push != False) %}&disablePush={{ disable_push }}{% endif %}' \
361361
'{% if push_ext is not none %}&pushExt={{ push_ext }}{% endif %}'
362362
try:
363363
self._check_param(from_user_id, str, '1~64')
@@ -372,6 +372,7 @@ def send(self, from_user_id, to_group_id, object_name, content, push_content=Non
372372
self._check_param(content_available, int, '0~1')
373373
self._check_param(expansion, bool)
374374
self._check_param(disable_push, bool)
375+
self._check_param(push_ext, str)
375376
return self._http_post(url, self._render(param_dict, format_str))
376377
except ParamException as e:
377378
return json.loads(str(e))
@@ -675,6 +676,7 @@ def send(self, from_user_id, to_user_ids, object_name, content, push_content=Non
675676
self._check_param(is_persisted, int, '0~1')
676677
self._check_param(content_available, int, '0~1')
677678
self._check_param(disable_push, bool)
679+
self._check_param(push_ext, str)
678680
return self._http_post(url, self._render(param_dict, format_str))
679681
except ParamException as e:
680682
return json.loads(str(e))

0 commit comments

Comments
 (0)