Skip to content

Commit

Permalink
Update format.py (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhluca authored Apr 4, 2024
1 parent 6d24d84 commit d00cc3f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions weblinx/utils/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ def format_uid(turn, uid_key="data-webtasks-id", return_as="dict"):
formatted : str or dict
A string or dictionary representing the uid.
"""
if turn.element is None:
raise ValueError(f"format_uid received a turn object with turn.element missing (None): {turn}")
output = {"uid": turn.element.get("attributes", {}).get(uid_key, None)}

return format_output_dictionary(output, return_as=return_as)
Expand Down

0 comments on commit d00cc3f

Please sign in to comment.