浏览代码

[minor] [fix] extract images before sanitizing html for text editor (#2319)

version-14
Rushabh Mehta 8 年前
committed by GitHub
父节点
当前提交
e4f279b580
共有 1 个文件被更改,包括 2 次插入5 次删除
  1. +2
    -5
      frappe/model/document.py

+ 2
- 5
frappe/model/document.py 查看文件

@@ -382,6 +382,7 @@ class Document(BaseDocument):
self._validate_selects()
self._validate_constants()
self._validate_length()
self._extract_images_from_text_editor()
self._sanitize_content()
self._save_passwords()

@@ -390,6 +391,7 @@ class Document(BaseDocument):
d._validate_selects()
d._validate_constants()
d._validate_length()
d._extract_images_from_text_editor()
d._sanitize_content()
d._save_passwords()

@@ -398,11 +400,6 @@ class Document(BaseDocument):
for fieldname in optional_fields:
self.set(fieldname, None)

# extract images after validations to save processing if some validation error is raised
self._extract_images_from_text_editor()
for d in children:
d._extract_images_from_text_editor()

def apply_fieldlevel_read_permissions(self):
'''Remove values the user is not allowed to read (called when loading in desk)'''
has_higher_permlevel = False


正在加载...
取消
保存