Browse Source

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

version-14
Rushabh Mehta 8 years ago
committed by GitHub
parent
commit
e4f279b580
1 changed files with 2 additions and 5 deletions
  1. +2
    -5
      frappe/model/document.py

+ 2
- 5
frappe/model/document.py View File

@@ -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


Loading…
Cancel
Save