Skip to content

Commit 6173c75

Browse files
committed
fix calling of get_class_from_string, bump version
1 parent fa3e405 commit 6173c75

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

frost_sta_client/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__title__ = 'frost_sta_client'
2-
__version__ = '1.1.35'
2+
__version__ = '1.1.36'
33
__license__ = 'LGPL3'
44
__author__ = 'Katharina Emde'
55
__copyright__ = 'Fraunhofer IOSB'

frost_sta_client/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ def class_from_string(string):
3636
return getattr(sys.modules[module_name], class_name)
3737

3838
def transform_json_to_entity(json_response, entity_class):
39-
obj = entity_class()
39+
cl = class_from_string(entity_class)
40+
obj = cl()
4041
obj.__setstate__(json_response)
4142
return obj
4243

@@ -54,8 +55,7 @@ def transform_json_to_entity_list(json_response, entity_class):
5455
response_list = json_response
5556
else:
5657
raise ValueError("expected json as a dict or list to transform into entity list")
57-
ent_cl = class_from_string(entity_list.entity_class)
58-
entity_list.entities = [transform_json_to_entity(item, ent_cl) for item in response_list]
58+
entity_list.entities = [transform_json_to_entity(item, entity_list.entity_class) for item in response_list]
5959
return entity_list
6060

6161

0 commit comments

Comments
 (0)