From 95bbbc8fa5bed09feee256c2c22c5922c57fb8f8 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 9 Nov 2021 20:42:54 +0300 Subject: [PATCH] =?UTF-8?q?[+]=20=D0=92=D0=BE=D0=B7=D0=B2=D1=80=D0=B0?= =?UTF-8?q?=D1=82=20=D0=BD=D0=B5=D1=81=D0=BA=D0=BE=D0=BB=D1=8C=D0=BA=D0=B8?= =?UTF-8?q?=D1=85=20e-mail=20=D0=B8=D0=BB=D0=B8=20=D0=BD=D0=BE=D0=BC=D0=B5?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=20=D1=82=D0=B5=D0=BB=D0=B5=D1=84=D0=BE=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=20=D0=B5=D1=81=D0=BB=D0=B8=20=D1=82=D0=B0=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2=D1=8B=D1=85=20=D1=83=20=D0=BA=D0=BE=D0=BD=D1=82?= =?UTF-8?q?=D0=B0=D0=BA=D1=82=D0=B0=20=D0=BD=D0=B5=D1=81=D0=BA=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D0=BA=D0=BE(=D0=BE=D0=B4=D0=BD=D0=BE=D0=B3=D0=BE=20?= =?UTF-8?q?=D1=82=D0=B8=D0=BF=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amocrm/v2/entity/custom_field.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/amocrm/v2/entity/custom_field.py b/amocrm/v2/entity/custom_field.py index a87ec7a..60f65e6 100644 --- a/amocrm/v2/entity/custom_field.py +++ b/amocrm/v2/entity/custom_field.py @@ -252,9 +252,15 @@ def __init__(self, *args, enum_code="WORK", **kwargs): super().__init__(*args, **kwargs) def on_get(self, values): + response = [] for value in values: if value["enum_code"] == self._enum_code: - return value["value"] + response += [value['value']] + + if len(response) == 1: + return response[0] + + return response def on_set_instance(self, values, value): for item in values: