Skip to content

Commit

Permalink
type check bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
leshchenko1979 committed Jul 29, 2020
1 parent e2d2d5e commit 31f307f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions fast_bitrix24/bitrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,17 +411,18 @@ def _check_params(p):
'order': dict,
'filter': dict,
'start': int,
'fields': dict
'fields': dict,
'id': None
}

for pk in p.keys():
if pk not in clauses.keys():
if pk.lower() not in clauses.keys():
raise ValueError(f'Unknown clause "{pk}" in params argument')

# check for allowed types of key values
for pi in p.items():
t = clauses[pi[0]]
if not (
t = clauses[pi[0].lower()]
if t and not (
(isinstance(pi[1], t)) or
((t == list) and (any([isinstance(pi[1], x) for x in [list, tuple, set]])))
):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="fast_bitrix24",
version="0.2.5",
version="0.2.6",
author="Alexey Leshchenko",
author_email="leshchenko@gmail.com",
description="A high-level Python SDK for Bitrix24 REST API aiming for speed of high volume transactions. Async operations, automatic batching and traffic throttling to prevent server rejections.",
Expand Down

0 comments on commit 31f307f

Please sign in to comment.