Skip to content

Commit

Permalink
Remove deprecated bleach dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Jun 11, 2024
1 parent 45c91dd commit 93cc133
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
10 changes: 1 addition & 9 deletions backend/core/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from django.db import models
from core.serializer_fields import FieldsRelatedField

import structlog, bleach, html
import structlog, html

logger = structlog.get_logger(__name__)

Expand Down Expand Up @@ -53,14 +53,6 @@ def create(self, validated_data: Any):
logger.error(e)
raise serializers.ValidationError(e.args[0])

def validate_name(self, value):
clean_value = html.unescape(bleach.clean(value, strip=True))
if clean_value != value:
raise serializers.ValidationError(
"The name is not valid due to HTML tags or attributes"
)
return value

class Meta:
model: models.Model

Expand Down
1 change: 0 additions & 1 deletion backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ python-dotenv==1.0.1
drf-spectacular==0.27.2
django-rest-knox==4.2.0
pre-commit==3.7.1
bleach==6.1.0

0 comments on commit 93cc133

Please sign in to comment.