Skip to content

Commit

Permalink
Handle missing record in restapi endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk committed Mar 14, 2024
1 parent 0c0ab53 commit d3a9618
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Changelog
1.3.1 (unreleased)
------------------

- Nothing changed yet.
- Handle missing record in restapi endpoint.
[cekk]


1.3.0 (2024-03-07)
Expand Down
9 changes: 6 additions & 3 deletions src/redturtle/voltoplugin/editablefooter/restapi/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@
class EditableFooterGet(Service):
def reply(self):
res = {"footer_top": None, "footer_columns": None}
footer_top = api.portal.get_registry_record(
"footer_top", interface=IEditableFooterSettings, default=""
)
footer_columns = api.portal.get_registry_record(
"footer_columns", interface=IEditableFooterSettings, default=""
)
try:
footer_top = api.portal.get_registry_record(
"footer_top", interface=IEditableFooterSettings, default=""
)
except KeyError:
footer_top = ""
if footer_top:
res["footer_top"] = json.loads(footer_top)
if not footer_columns:
Expand Down

0 comments on commit d3a9618

Please sign in to comment.