Skip to content
Snippets Groups Projects
Commit eca47671 authored by ynerant's avatar ynerant
Browse files

Mark fields in TeX templates as safe

parent 21ba46c1
No related branches found
No related tags found
3 merge requests!104Beta,!98Morefront,!91Documents
Pipeline #8463 canceled with stages
...@@ -137,7 +137,7 @@ class Product(models.Model): ...@@ -137,7 +137,7 @@ class Product(models.Model):
@property @property
def amount_euros(self): def amount_euros(self):
return self.amount / 100 return "{:.2f}".format(self.amount / 100)
@property @property
def total(self): def total(self):
...@@ -145,7 +145,7 @@ class Product(models.Model): ...@@ -145,7 +145,7 @@ class Product(models.Model):
@property @property
def total_euros(self): def total_euros(self):
return self.total / 100 return "{:.2f}".format(self.total / 100)
class Meta: class Meta:
verbose_name = _("product") verbose_name = _("product")
......
...@@ -2,10 +2,11 @@ ...@@ -2,10 +2,11 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
from django import template from django import template
from django.utils.safestring import mark_safe
def do_latex_escape(value): def do_latex_escape(value):
return ( return mark_safe(
value.replace("&", "\\&") value.replace("&", "\\&")
.replace("$", "\\$") .replace("$", "\\$")
.replace("%", "\\%") .replace("%", "\\%")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment