Forráskód Böngészése

HUE-7552 [fb] Copy Folder Into Itself Causes Endless Loop

Ying Chen 8 éve
szülő
commit
e6bce8a8a1
1 módosított fájl, 2 hozzáadás és 0 törlés
  1. 2 0
      apps/filebrowser/src/filebrowser/views.py

+ 2 - 0
apps/filebrowser/src/filebrowser/views.py

@@ -1173,6 +1173,8 @@ def copy(request):
     params = ['src_path']
     def bulk_copy(*args, **kwargs):
         for arg in args:
+            if arg['src_path'] == arg['dest_path']:
+                raise PopupException(_('Source path and destination path cannot be same'))
             request.fs.copy(arg['src_path'], arg['dest_path'], recursive=True, owner=request.user)
     return generic_op(CopyFormSet, request, bulk_copy, ["src_path", "dest_path"], None,
                       data_extractor=formset_data_extractor(recurring, params),