mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2024-12-29 16:41:56 +00:00
11 lines
285 B
Python
11 lines
285 B
Python
from django.contrib.postgres.fields 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 "")
|