Skip to content

Commit 47b7b09

Browse files
author
Joel Collins
committed
Fix #3
1 parent 4a5cb86 commit 47b7b09

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

labthings_client/affordances.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,20 @@ def set(self, *args, **kwargs):
4747
return self.put(*args, **kwargs)
4848

4949
def put(self, value):
50+
if value is None:
51+
value = {}
5052
if not self.read_only:
51-
r = requests.put(self.self_url, json=value or {})
53+
r = requests.put(self.self_url, json=value)
5254
r.raise_for_status()
5355
return r.json()
5456
else:
5557
raise AttributeError("Can't set attribute, is read-only")
5658

5759
def post(self, value):
60+
if value is None:
61+
value = {}
5862
if not self.read_only:
59-
r = requests.post(self.self_url, json=value or {})
63+
r = requests.post(self.self_url, json=value)
6064
r.raise_for_status()
6165
return r.json()
6266
else:

0 commit comments

Comments
 (0)