Skip to content

Commit

Permalink
Don't listify strings
Browse files Browse the repository at this point in the history
  • Loading branch information
vanatteveldt committed Feb 19, 2025
1 parent f6715b6 commit 1ea8ea6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion amcat4/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def coerce_type(value: Any, type: FieldType):
"""
if type == "date" and isinstance(value, datetime.date):
return value.isoformat()
if type == "tag" and isinstance(value, Iterable):
if type == "tag" and isinstance(value, Iterable) and not isinstance(value, str):
return [str(val) for val in value]
if type in ["text", "tag", "image", "video", "audio", "date"]:
return str(value)
Expand Down

0 comments on commit 1ea8ea6

Please sign in to comment.