:art: Qiniu Once

huangqimin001 лет %!s(int64=3): %!d(string=назад)
Родитель
Сommit
87de9bd8bf
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      commands/management/commands/qiniuonce.py

+ 5 - 0
commands/management/commands/qiniuonce.py

@@ -14,6 +14,11 @@ class Command(CompatibilityBaseCommand):
14 14
 
15 15
         for file in files:
16 16
             print(file)
17
+            ext = file.split('.')[-1]
18
+            if not ext:
19
+                continue
20
+            if ext.lower() not in ['jpg', 'jpeg', 'png']:
21
+                continue
17 22
             try:
18 23
                 file_path = 'media/file/{}'.format(file)
19 24
                 if os.path.exists(file_path):