Open LoremoCH opened 7 years ago
Ich nehme an, du meinst das &
?
Ja.
While we could avoid this with an {% autoescape off %}
block in the affected template(s), that would be an IMHO semantically wrong approach, as it'd imply that we know the result is HTML-safe, while it in fact emphatically isn't;—we're just not using the rendered string in a plain text email thus why it doesn't have to be HTML-safe. Instead, I'd like to control the (not-)escaping from a part of the code where I know about this usage, rather than in the template itself, which could at least theoretically also be used in an HTML context where escaping would be necessary.
Controlling this elegantly at render-time (which is the one place where it can be seen how the resulting string will be further used in subsequent code) becomes possible in Django 1.10, by using a separately set up template engine that has the autoescape
option set to False
.
Thus, let's update to Django 1.10 before tackling this.
Status report:
From Django 2.0 on, Engine.get_default()
will return the first DjangoTemplates engine. This is how Template()
gets the Engine it'll use (if none is passed as argument), so that crispy-froms that uses this shouldn't fail anymore when several engines are present.
Thus, we can attempt that fix again after upgrading to Django ≥ 2.0.
Die Mail Benachrichtigungen von osmaxx haben ein Encoding Problem. Umlaute wie ä/ö/ü im Namen des Exportes (wie hier Süddeutschland) funktionieren hingegen. Getestet habe ich nur mit G-Mail (Web sowie Andorid App) und Thunderbird.