Opened 7 weeks ago

Closed 5 weeks ago

#35935 closed Cleanup/optimization (fixed)

sqlmigrate prevents normal colorization of system checks

Reported by: Jacob Walls Owned by: Jacob Walls
Component: Core (Management commands) Version: dev
Severity: Normal Keywords: no_color
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

sqlmigrate forces no_color=True for the sake of not colorizing the sql keywords BEGIN; and COMMIT;, but this has the side effect of preventing system check output from being colorized.

(To reproduce, begin with a project that will emit a system check, and run sqlmigrate.)

Suggesting a small PR to preserve the non-colorization of BEGIN; and COMMIT; while still colorizing system checks.

Change History (4)

comment:1 by Natalia Bidart, 7 weeks ago

Needs tests: set
Triage Stage: UnreviewedAccepted

Thank you Jacob, was able to reproduce adding something like this to an existing model (an FK with unique=True):

user = models.ForeignKey("auth.User", unique=True, on_delete=models.CASCADE)

For the PR, do you think you could also provide a regression test where there is actually a warning system check emitted and then an assert that the system check is indeed colorized with your changes?

comment:2 by Jacob Walls, 7 weeks ago

Needs tests: unset

comment:3 by Sarah Boyce, 5 weeks ago

Triage Stage: AcceptedReady for checkin

comment:4 by Sarah Boyce <42296566+sarahboyce@…>, 5 weeks ago

Resolution: fixed
Status: assignedclosed

In d345e5b5:

Fixed #35935 -- Colorized system checks when running sqlmigrate.

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