diff --git a/api/funkwhale_api/subsonic/renderers.py b/api/funkwhale_api/subsonic/renderers.py
index a1e66cb56..54c4a4063 100644
--- a/api/funkwhale_api/subsonic/renderers.py
+++ b/api/funkwhale_api/subsonic/renderers.py
@@ -75,7 +75,12 @@ def dict_to_xml_tree(root_tag, d, parent=None):
root.append(dict_to_xml_tree(key, value, parent=root))
elif isinstance(value, list):
for obj in value:
- root.append(dict_to_xml_tree(key, obj, parent=root))
+ if isinstance(obj, dict):
+ el = dict_to_xml_tree(key, obj, parent=root)
+ else:
+ el = ET.Element(key)
+ el.text = str(obj)
+ root.append(el)
else:
if key == "value":
root.text = str(value)
diff --git a/api/tests/subsonic/test_renderers.py b/api/tests/subsonic/test_renderers.py
index 501ae48ce..435f206a0 100644
--- a/api/tests/subsonic/test_renderers.py
+++ b/api/tests/subsonic/test_renderers.py
@@ -70,9 +70,10 @@ def test_xml_renderer_dict_to_xml():
payload = {
"hello": "world",
"item": [{"this": 1, "value": "text"}, {"some": "node"}],
+ "list": [1, 2],
}
expected = """
-- text
"""
+- text
1
2
"""
result = renderers.dict_to_xml_tree("key", payload)
exp = ET.fromstring(expected)
assert ET.tostring(result) == ET.tostring(exp)
diff --git a/changes/changelog.d/subsonic-attribute-error.bugfix b/changes/changelog.d/subsonic-attribute-error.bugfix
new file mode 100644
index 000000000..2bebab3f1
--- /dev/null
+++ b/changes/changelog.d/subsonic-attribute-error.bugfix
@@ -0,0 +1 @@
+Fix an error in a Subsonic methods that return lists of numbers/strings like getUser