diff options
author | BonfaceKilz | 2020-08-27 03:26:36 +0300 |
---|---|---|
committer | BonfaceKilz | 2020-08-27 03:26:36 +0300 |
commit | b46faf479e129801f4bec2457444b5341e8aeabf (patch) | |
tree | 9beb2ef7e93dabbc95c130164a8fdc174318c2a2 /wqflask | |
parent | c6c80dde5cfb03c73b61523950af0ca6d208aea4 (diff) | |
download | genenetwork2-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.
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/views.py | 4 |
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__ |