:art: Qiniu Once

huangqimin001 3 年之前
父节点
当前提交
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):