move files;cleanup empty folders

This commit is contained in:
j 2016-01-14 16:14:11 +05:30
commit 173fde1d1b
2 changed files with 7 additions and 0 deletions

View file

@ -618,6 +618,8 @@ class File(db.Model):
shutil.move(current_path, path)
self.path = new_path
self.save()
for folder in set(os.path.dirname(p) for p in [current_path, path]):
remove_empty_folders(folder)
def save(self):
state.db.session.add(self)