Skip to content

Commit cf3b16c

Browse files
committed
fix overwriting of service url
1 parent fa86fef commit cf3b16c

3 files changed

Lines changed: 14 additions & 11 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.32'
2+
__version__ = '1.1.33'
33
__license__ = 'LGPL3'
44
__author__ = 'Katharina Emde'
55
__copyright__ = 'Fraunhofer IOSB'

frost_sta_client/dao/observation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(self, service):
3535
base.BaseDao.__init__(self, service, EntityTypes["Observation"])
3636

3737
def create(self, data_array):
38-
url = self.service.url
38+
url = self.service.url.copy()
3939
url.path.add(self.CREATE_OBSERVATIONS)
4040
logging.debug('Posting to ' + str(url.url))
4141
json_dict = transform_entity_to_json_dict(data_array.value)

frost_sta_client/model/ext/unitofmeasurement.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,32 @@ def name(self):
2929

3030
@name.setter
3131
def name(self, value):
32-
if not isinstance(value, str):
33-
raise ValueError('name should be of type str!')
34-
self._name = value
32+
if isinstance(value, str) or value is None:
33+
self._name = value
34+
return
35+
raise ValueError('name should be of type str!')
3536

3637
@property
3738
def symbol(self):
3839
return self._symbol
3940

4041
@symbol.setter
4142
def symbol(self, value):
42-
if not isinstance(value, str):
43-
raise ValueError('symbol should be of type str!')
44-
self._symbol = value
43+
if isinstance(value, str) or value is None:
44+
self._symbol = value
45+
return
46+
raise ValueError('symbol should be of type str!')
4547

4648
@property
4749
def definition(self):
4850
return self._definition
4951

5052
@definition.setter
5153
def definition(self, value):
52-
if not isinstance(value, str):
53-
raise ValueError('definition should be of type str!')
54-
self._definition = value
54+
if isinstance(value, str) or value is None:
55+
self._definition = value
56+
return
57+
raise ValueError('definition should be of type str!')
5558

5659
def __getstate__(self):
5760
data = {

0 commit comments

Comments
 (0)