ソースを参照

Merge pull request #3953 from ci2014/patch-10

Update file.py
version-14
Rushabh Mehta 8年前
committed by GitHub
コミット
11899dbb81
1個のファイルの変更5行の追加0行の削除
  1. +5
    -0
      frappe/core/doctype/file/file.py

+ 5
- 0
frappe/core/doctype/file/file.py ファイルの表示

@@ -329,7 +329,12 @@ def setup_folder_path(filename, new_parent):


def get_extension(filename, extn, content): def get_extension(filename, extn, content):
mimetype = None mimetype = None

if extn: if extn:
# remove '?' char and parameters from extn if present
if '?' in extn:
extn = extn.split('?', 1)[0]

mimetype = mimetypes.guess_type(filename + "." + extn)[0] mimetype = mimetypes.guess_type(filename + "." + extn)[0]


if mimetype is None or not mimetype.startswith("image/") and content: if mimetype is None or not mimetype.startswith("image/") and content:


読み込み中…
キャンセル
保存