Opened 2 years ago

Closed 2 years ago

#34279 closed Bug (invalid)

Certain character causes django admin to misfunction

Reported by: Emad Gasser Owned by: Emad Gasser
Component: Database layer (models, ORM) Version: 4.1
Severity: Normal Keywords: Django-admin, field-help_text, models, admin, orm
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When adding a help_text attribute to a field in models,
eg: "This field can be left blank if <v1> is False" (where v1 is used as a variable placeholder in string format for explanation purposes).

When logging into that table in Django admin panel, all fields after that field with the help_text don't appear, making it impossible to make, alter, or delete objects. After several troubleshooting, I discovered that the '>' character was what caused it to break, which hence suggests that it may have been identified as a closing tag, making everything after that field disappear.

https://github.com/Emad-Eldin-G/Emad-Eldin-G/blob/main/django%20error.jpg
Example shown in the image above ⬆️. As shown the help text suddenly breaks after ':', and nothing appears

Attachments (1)

django error.jpg (44.4 KB ) - added by Emad Gasser 2 years ago.

Download all attachments as: .zip

Change History (3)

by Emad Gasser, 2 years ago

Attachment: django error.jpg added

comment:1 by Emad Gasser, 2 years ago

Owner: changed from nobody to Emad Gasser
Status: newassigned

comment:2 by Tim Graham, 2 years ago

Resolution: invalid
Severity: Release blockerNormal
Status: assignedclosed

This is a usage mistake. Per the documentation for Field.help_text:

Note that this value is not HTML-escaped in automatically-generated forms. This lets you include HTML in help_text if you so desire. .. you can use plain text and django.utils.html.escape() to escape any HTML special characters.

Note: See TracTickets for help on using tickets.
Back to Top