Преглед на файлове

[tasks] Fix bug in note str method

Colin Powell преди 3 седмици
родител
ревизия
ae889bff7d
променени са 1 файла, в които са добавени 5 реда и са изтрити 4 реда
  1. 5 4
      vrobbler/apps/tasks/models.py

+ 5 - 4
vrobbler/apps/tasks/models.py

@@ -39,11 +39,12 @@ class TaskLogData(JSONDataclass):
     def notes_as_str(self) -> str:
         """Return formatted notes with line breaks and no keys"""
         note_block = ""
-        if not self.notes:
-            return note_block
+        if isinstance(self.notes, list):
+            note_block = "</br>".join(self.notes)
 
-        for id, content in self.notes.items():
-            note_block += content + "</br>"
+        if isinstance(self.notes, dict):
+            for id, content in self.notes.items():
+                note_block += content + "</br>"
         return note_block