aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBonfaceKilz2020-08-27 03:26:36 +0300
committerBonfaceKilz2020-08-27 03:26:36 +0300
commitb46faf479e129801f4bec2457444b5341e8aeabf (patch)
tree9beb2ef7e93dabbc95c130164a8fdc174318c2a2
parentc6c80dde5cfb03c73b61523950af0ca6d208aea4 (diff)
downloadgenenetwork2-b46faf479e129801f4bec2457444b5341e8aeabf.tar.gz
Add a check for a "uuid" object
* wqflask/wqflask/views.py(json_default_handler): Check for "uuid.UUID" instance to avoid TypeError.
-rw-r--r--wqflask/wqflask/views.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 0224da4a..557ff523 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -930,8 +930,8 @@ def json_default_handler(obj):
if hasattr(obj, 'isoformat'):
return obj.isoformat()
# Handle integer keys for dictionaries
- elif isinstance(obj, int):
- return str(int)
+ elif isinstance(obj, int) or isinstance(obj, uuid.UUID):
+ return str(obj)
# Handle custom objects
if hasattr(obj, '__dict__'):
return obj.__dict__