From 62ef8cdb650aef2dd68dd24b4a87a20623aea743 Mon Sep 17 00:00:00 2001 From: Alexey Leshchenko Date: Tue, 23 Jul 2024 22:07:47 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D1=82=D1=8C=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B5=D0=B4=D1=83=D0=BF=D1=80=D0=B5=D0=B6=D0=B4?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5,=20=D1=87=D1=82=D0=BE=20tasks.*=20?= =?UTF-8?q?=E2=80=94=20=D1=82=D1=83=D0=BF=D0=B0=D1=8F=20=D0=B2=D0=B5=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=D0=BE=D0=B2,=20?= =?UTF-8?q?=D1=82=D0=B0=D0=BC=20=D1=82=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20cal?= =?UTF-8?q?l=5Fraw,=20=D0=B0=20=D0=BD=D0=B5=20call=20Fixes=20#239?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fast_bitrix24/user_request.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/fast_bitrix24/user_request.py b/fast_bitrix24/user_request.py index 67de81a..0a061d5 100644 --- a/fast_bitrix24/user_request.py +++ b/fast_bitrix24/user_request.py @@ -130,8 +130,8 @@ class GetAllUserRequest(UserRequestAbstract): "get_all() doesn't support parameters 'start' or 'order'", ) @icontract.require( - lambda self: not self.st_method.startswith("tasks.elapseditem."), - "get_all() shouldn't be used with 'tasks.elapseditem.*' method group. " + lambda self: not self.st_method.startswith("tasks."), + "get_all() shouldn't be used with 'tasks.*' method group. " "Use call(raw=True) instead. Read more: " "https://github.com/leshchenko1979/fast_bitrix24/issues/199", ) @@ -270,6 +270,12 @@ def __init__( "get_by_ID(): 'ID_list' should be a Sequence " "if a progress bar is to be displayed", ) + @icontract.require( + lambda self: not self.st_method.startswith("tasks."), + "get_by_ID() shouldn't be used with 'tasks.*' method group. " + "Use call(raw=True) instead. Read more: " + "https://github.com/leshchenko1979/fast_bitrix24/issues/199", + ) def check_special_limitations(self): return True @@ -307,6 +313,12 @@ def __init__(self, bitrix, method: str, item_list: Union[Dict, Iterable[Dict]]): "call(): 'ID_list' should be a Sequence " "if a progress bar is to be displayed", ) + @icontract.require( + lambda self: not self.st_method.startswith("tasks."), + "call(raw=False) shouldn't be used with 'tasks.*' method group. " + "Use call(raw=True) instead. Read more: " + "https://github.com/leshchenko1979/fast_bitrix24/issues/199", + ) def check_special_limitations(self): if self.st_method.endswith(GET_ALL_ENDINGS): warnings.warn(