Skip to content

Commit

Permalink
Strip html tags from offer description
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertoMoreta committed Mar 19, 2024
1 parent 38214f0 commit 58fcf26
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion offers/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponseRedirect
from django.utils.html import strip_tags
from django.utils.translation import gettext as _

from django.urls import reverse
Expand Down Expand Up @@ -62,7 +63,7 @@ def form_valid(self, form):
node_shortname=offer.provider.node.shortname,
event=NotificationEvent.OFFER_ADDED,
title=offer.title,
body=offer.description,
body=strip_tags(offer.description),
data={'proveedora': offer.provider.name, 'id': str(offer.pk)},
image=self.request.build_absolute_uri(offer.banner_thumbnail.url) if offer.banner_thumbnail.name else None,
)
Expand Down

0 comments on commit 58fcf26

Please sign in to comment.