:art: Add upload qiniu path & Delete empty dir

huangqimin001 1 неделя назад
Родитель
Сommit
dd4f2d0810
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      commands/management/commands/qiniuuncompressed.py

+ 3 - 1
commands/management/commands/qiniuuncompressed.py

@@ -10,7 +10,7 @@ from utils.qiniucdn import upload_file_path
10 10
 class Command(CompatibilityBaseCommand):
11 11
     def handle(self, *args, **options):
12 12
 
13
-        dirs = ['media/user/member_activity', 'media/qn']
13
+        dirs = ['media/salesman', 'media/user/member_activity', 'media/qn']
14 14
 
15 15
         for dir in dirs:
16 16
             for root, dirs, files in os.walk(dir):
@@ -18,6 +18,8 @@ class Command(CompatibilityBaseCommand):
18 18
                 print('Root: {}'.format(root))
19 19
                 print('Dirs: {}'.format(dirs))
20 20
                 print('Files: {}'.format(files))
21
+                if not dirs and not files:
22
+                    os.rmdir(root)
21 23
                 for file in files:
22 24
                     print('  >> File: {}'.format(file))
23 25
                     ext = file.split('.')[-1]