Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#28508 closed Bug (fixed)

Error views set background-color but not foreground color

Reported by: John Dallahan Owned by: Darius Azimi
Component: Error reporting Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: yes

Description

CSRF error pages and 404 pages do not set the text color in their inline styles, but they set background-color, making it annoying to view them with dark GTK themes. Relevant lines:
https://github.com/django/django/blob/master/django/views/templates/technical_404.html#L11
https://github.com/django/django/blob/master/django/views/csrf.py#L26
The 500 page does have it set, though:
https://github.com/django/django/blob/master/django/views/templates/technical_500.html#L12

Attachments (1)

Screen Shot 2017-08-19 at 14.58.43.png (36.3 KB) - added by John Dallahan 2 years ago.
What the page looks like in my browser

Download all attachments as: .zip

Change History (7)

Changed 2 years ago by John Dallahan

What the page looks like in my browser

comment:1 Changed 2 years ago by Claude Paroz

Component: UncategorizedCore (Other)
Easy pickings: set
Triage Stage: UnreviewedAccepted

comment:2 in reply to:  description Changed 2 years ago by Darius Azimi

Owner: changed from nobody to Darius Azimi
Status: newassigned

To make sure I understand it correctly, using the same text and background from technical_500 on other pages of csrf and technical_404 would correct this issue?

Replying to John Dallahan:

CSRF error pages and 404 pages do not set the text color in their inline styles, but they set background-color, making it annoying to view them with dark GTK themes. Relevant lines:
https://github.com/django/django/blob/master/django/views/templates/technical_404.html#L11
https://github.com/django/django/blob/master/django/views/csrf.py#L26
The 500 page does have it set, though:
https://github.com/django/django/blob/master/django/views/templates/technical_500.html#L12

comment:3 Changed 2 years ago by John Dallahan

Yes, that should fix the issue. I recommend using a common template which is extended by error views, though.

comment:4 Changed 2 years ago by Abhishek

this ticket needs review

comment:5 Changed 2 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 347551c2:

Fixed #28508 -- Set the foreground color to black in CSRF and 404 error templates.

comment:6 Changed 2 years ago by Tim Graham

Component: Core (Other)Error reporting
Summary: Error views set background-color bot not foreground colorError views set background-color but not foreground color
Note: See TracTickets for help on using tickets.
Back to Top