Skip to content
Snippets Groups Projects
Commit 54fe49f3 authored by Tomi Valentová's avatar Tomi Valentová
Browse files

escape json dump from fullcalendar

parent a67d1b1d
No related branches found
No related tags found
2 merge requests!1118escape json dump from fullcalendar,!1117escape json dump from fullcalendar
Pipeline #19520 passed
......@@ -8,6 +8,7 @@ from django.core.serializers.json import DjangoJSONEncoder
from django.core.validators import URLValidator, ValidationError
from django.db import models, transaction
from django.utils.timezone import now
from django.utils.html import escape
from .icalevents import icalevents
from .parser import process_event_list
......@@ -132,7 +133,7 @@ class CalendarMixin(models.Model):
calendar_format_events.append(parsed_event)
return json.dumps(calendar_format_events)
return escape(json.dumps(calendar_format_events))
def save(self, *args, **kwargs):
# create or update related Calendar
......
......@@ -808,12 +808,12 @@ class DistrictCenterPage(
desc = None
if self.perex:
if hasattr(self, "perex") and self.perex:
desc = self.perex
elif self.text:
elif hasattr(self, "text") and self.text:
desc = trim_to_length(strip_all_html_tags(self.text))
return desc
return ""
class DistrictNewProgramPage(MainProgramPageMixin):
......
......@@ -5,6 +5,7 @@
{% endblock %}
{% block inner_content %}
<div class="container--wide">
<div class="__js-root __inner-content">
<ui-full-calendar
{% if page.calendar_url %}
......@@ -14,4 +15,5 @@
{% endif %}
></ui-full-calendar>
</div>
</div>
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment