Skip to content

Commit

Permalink
escape json value in relation template (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
jowilf authored Oct 25, 2024
1 parent c438bd9 commit 64ce44b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion starlette_admin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.15.0rc0"
__version__ = "0.15.0rc1"

from ._types import ExportType as ExportType
from ._types import RequestAction as RequestAction
Expand Down
2 changes: 1 addition & 1 deletion starlette_admin/templates/forms/relation.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class="form-control {{ 'field-has-one' if not field.many else 'field-has-many' }} {% if error %}is-invalid{% endif %}"
data-url="{{ url_for(__name__ ~ ':api', identity=foreign_model.identity) }}"
data-pk="{{ fpk }}"
{% if data %}data-initial="{{ (data if field.multiple else [data]) |tojson }}" {% endif %}
{% if data %}data-initial="{{ (data if field.multiple else [data]) |tojson |forceescape }}" {% endif %}
{% if field.multiple %}multiple{% endif %}>
</select>
{% if field.help_text %}
Expand Down

0 comments on commit 64ce44b

Please sign in to comment.