Przeglądaj źródła

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

version-14
Rushabh Mehta 8 lat temu
committed by GitHub
rodzic
commit
e4f279b580
1 zmienionych plików z 2 dodań i 5 usunięć
  1. +2
    -5
      frappe/model/document.py

+ 2
- 5
frappe/model/document.py Wyświetl plik

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


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


@@ -398,11 +400,6 @@ class Document(BaseDocument):
for fieldname in optional_fields: for fieldname in optional_fields:
self.set(fieldname, None) 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): def apply_fieldlevel_read_permissions(self):
'''Remove values the user is not allowed to read (called when loading in desk)''' '''Remove values the user is not allowed to read (called when loading in desk)'''
has_higher_permlevel = False has_higher_permlevel = False


Ładowanie…
Anuluj
Zapisz