Browse Source

serialize filename as label when no label setup for a file

Damien ACCORSI 10 years ago
parent
commit
7c5e7acb82
1 changed files with 2 additions and 1 deletions
  1. 2 1
      tracim/tracim/model/serializers.py

+ 2 - 1
tracim/tracim/model/serializers.py View File

@@ -259,7 +259,8 @@ def serialize_breadcrumb_item(content: Content, context: Context):
259 259
 def serialize_item(content: Content, context: Context):
260 260
     return DictLikeClass(
261 261
         id = content.content_id,
262
-        label = content.label,
262
+        label = content.label if content.label else content.file_name,
263
+        icon = ContentType.icon(content.type),
263 264
         status = context.toDict(content.get_status()),
264 265
         folder = context.toDict(DictLikeClass(id = content.parent.content_id if content.parent else None)),
265 266
         workspace = context.toDict(content.workspace),