OnlineJudge/utils/models.py
Beichi-CHs cef608b809
resolve backward compatibility issues
Signed-off-by: Beichi-CHs <g841734459@126.com>
2021-11-18 18:08:17 +08:00

11 lines
271 B
Python

from django.db.models import JSONField # NOQA
from django.db import models
from utils.xss_filter import XSSHtml
class RichTextField(models.TextField):
def get_prep_value(self, value):
with XSSHtml() as parser:
return parser.clean(value or "")