perf: Remove bleach from import tree

This commit is contained in:
Aditya Hase 2021-02-20 21:18:37 +05:30
parent 9b90d88170
commit 293c1c77e3
No known key found for this signature in database
GPG key ID: 0A55F0FCA0234972

View file

@ -2,11 +2,12 @@ from __future__ import unicode_literals
import frappe
import json
import re
import bleach
import bleach_whitelist.bleach_whitelist as bleach_whitelist
from six import string_types
def clean_html(html):
import bleach
if not isinstance(html, string_types):
return html
@ -18,6 +19,8 @@ def clean_html(html):
strip=True, strip_comments=True)
def clean_email_html(html):
import bleach
if not isinstance(html, string_types):
return html
@ -54,6 +57,7 @@ def sanitize_html(html, linkify=False):
Does not sanitize JSON, as it could lead to future problems
"""
import bleach
from bs4 import BeautifulSoup
if not isinstance(html, string_types):