Explorar el Código

Closes #169: File upload with same filename except extension fails

Bastien Sevajol (Algoo) hace 7 años
padre
commit
39670bece8
Se han modificado 1 ficheros con 7 adiciones y 2 borrados
  1. 7 2
      tracim/tracim/controllers/content.py

+ 7 - 2
tracim/tracim/controllers/content.py Ver fichero

@@ -287,14 +287,19 @@ class UserWorkspaceFolderFileRestController(TIMWorkspaceContentRestController):
287 287
 
288 288
     @tg.require(current_user_is_contributor())
289 289
     @tg.expose()
290
-    def put(self, item_id, file_data=None, comment=None, label=''):
290
+    def put(self, item_id, file_data=None, comment=None, label=None):
291 291
         # TODO - SECURE THIS
292 292
         workspace = tmpl_context.workspace
293 293
 
294 294
         try:
295 295
             api = ContentApi(tmpl_context.current_user)
296 296
             item = api.get_one(int(item_id), self._item_type, workspace)
297
-            label_changed = label != item.label
297
+            label_changed = False
298
+            if label is not None and label != item.label:
299
+                label_changed = True
300
+
301
+            if label is None:
302
+                label = ''
298 303
 
299 304
             # TODO - D.A. - 2015-03-19
300 305
             # refactor this method in order to make code easier to understand