Skip to content

Commit

Permalink
refactor: Убираем лишние теги
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis-Shtanskiy committed Jan 5, 2025
1 parent 682a724 commit 9c19112
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/backend/api/v1/profile/serializers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import html
# import html
from typing import ClassVar, Optional

import bleach
Expand Down Expand Up @@ -233,10 +233,10 @@ class Meta(BaseProfileSerializer.Meta):
)
read_only_fields = fields

def to_representation(self, instance):
rep = super().to_representation(instance)
rep["about"] = html.unescape(rep["about"])
return rep
# def to_representation(self, instance):
# rep = super().to_representation(instance)
# rep["about"] = html.unescape(rep["about"])
# return rep


class ProfileMeWriteSerializer(ProfileMeReadSerializer):
Expand Down
9 changes: 5 additions & 4 deletions src/backend/api/v1/projects/serializers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import html
from itertools import chain
from typing import Any, ClassVar, Dict, Optional, OrderedDict, Tuple

Expand Down Expand Up @@ -186,10 +187,10 @@ def get_unique_project_participants_skills(self, obj) -> list[Any]:
)
return list(set(all_skills))

# def to_representation(self, instance):
# rep = super().to_representation(instance)
# rep["description"] = html.unescape(rep["description"])
# return rep
def to_representation(self, instance):
rep = super().to_representation(instance)
rep["description"] = html.unescape(rep["description"])
return rep


class WriteProjectSerializer(
Expand Down

0 comments on commit 9c19112

Please sign in to comment.