Browse Source

Closes #148: Permit to update file label only

Bastien Sevajol (Algoo) 7 years ago
parent
commit
ddddc5e6c7
1 changed files with 2 additions and 2 deletions
  1. 2 2
      tracim/tracim/controllers/content.py

+ 2 - 2
tracim/tracim/controllers/content.py View File

283
         workspace = tmpl_context.workspace
283
         workspace = tmpl_context.workspace
284
 
284
 
285
         try:
285
         try:
286
-            item_saved = False
287
             api = ContentApi(tmpl_context.current_user)
286
             api = ContentApi(tmpl_context.current_user)
288
             item = api.get_one(int(item_id), self._item_type, workspace)
287
             item = api.get_one(int(item_id), self._item_type, workspace)
288
+            label_changed = label != item.label
289
 
289
 
290
             # TODO - D.A. - 2015-03-19
290
             # TODO - D.A. - 2015-03-19
291
             # refactor this method in order to make code easier to understand
291
             # refactor this method in order to make code easier to understand
292
 
292
 
293
             with new_revision(item):
293
             with new_revision(item):
294
 
294
 
295
-                if comment and label:
295
+                if (comment and label) or (not comment and label_changed):
296
                     updated_item = api.update_content(
296
                     updated_item = api.update_content(
297
                         item, label if label else item.label,
297
                         item, label if label else item.label,
298
                         comment if comment else ''
298
                         comment if comment else ''