Merge pull request #3305 from dato/export_catch_missing_key_icon
json_export: also detect absent "icon" key
This commit is contained in:
commit
6dfb5000cc
1 changed files with 1 additions and 4 deletions
|
@ -80,10 +80,7 @@ def json_export(
|
||||||
exported_user = user.to_activity()
|
exported_user = user.to_activity()
|
||||||
# I don't love this but it prevents a JSON encoding error
|
# I don't love this but it prevents a JSON encoding error
|
||||||
# when there is no user image
|
# when there is no user image
|
||||||
if isinstance(
|
if exported_user.get("icon") in (None, dataclasses.MISSING):
|
||||||
exported_user["icon"],
|
|
||||||
dataclasses._MISSING_TYPE, # pylint: disable=protected-access
|
|
||||||
):
|
|
||||||
exported_user["icon"] = {}
|
exported_user["icon"] = {}
|
||||||
else:
|
else:
|
||||||
# change the URL to be relative to the JSON file
|
# change the URL to be relative to the JSON file
|
||||||
|
|
Loading…
Add table
Reference in a new issue