Opened 4 years ago

Closed 3 years ago

#22195 closed Cleanup/optimization (fixed)

Use constants to define built-in tags

Reported by: Russell Keith-Magee Owned by: Tomáš Ehrlich
Component: Core (System checks) Version: 1.7-alpha-1
Severity: Normal Keywords:
Cc: Tim Martin, tomas.ehrlich@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no


Via discussion on django-developers:

The code for system checks currently uses freeform strings to register against tags (e.g., @register('compatibility')).

This is potentially prone to error, since you can easily mistype the string, and then the check won't get caught by the tag.

Internally, we should be using constants for built-in tags.

Attachments (1)

check-constants.diff (4.0 KB) - added by Tomáš Ehrlich 3 years ago.
Added constants for check tags.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 4 years ago by Tim Martin

Cc: Tim Martin added

Changed 3 years ago by Tomáš Ehrlich

Attachment: check-constants.diff added

Added constants for check tags.

comment:2 Changed 3 years ago by Tomáš Ehrlich

Cc: tomas.ehrlich@… added
Has patch: set
Owner: changed from nobody to Tomáš Ehrlich
Status: newassigned

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

Resolution: fixed
Status: assignedclosed

In 32e62374506827723423471a115e6b25313ed887:

[1.7.x] Fixed #22195 -- Used constants to define built-in tags for check framework.

Thanks Elvard for the patch.

Backport of b513fa5fc6 from master

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