Opened 4 years ago

Closed 4 years ago

Last modified 15 months ago

#23151 closed Cleanup/optimization (fixed)

Deprecate RegexField.error_message

Reported by: Baptiste Mispelon Owned by: nobody
Component: Forms Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Unlike other fields, RegexField takes an error_message argument (as opposed to the error_messages argument other fields take).

It seems this was done to maintain backwards compatibility with the pre-1.0 releases [1].

This argument is documented (and somewhat tested) but the documentation states that this is not the preferred way to do it (the preferred way being to use error_messages={'invalid': '...'}).

I propose we move through the deprecation procedure and remove that argument altogether.

Note that this feature is still used in django.contrib.flatpages.forms so this will also need to be changed over to the new and preferred syntax.

I'm marking the ticket as easy_pickings since the removal should be quite straightforward.

[1] https://github.com/django/django/commit/26ea06b0ab423348e40652dd9e3f530a08b93582#diff-2141c7b3d1c360359d58d724553afd06R377

Change History (6)

comment:1 Changed 4 years ago by Tim Graham

Has patch: set
Triage Stage: UnreviewedAccepted

comment:2 Changed 4 years ago by Baptiste Mispelon

Triage Stage: AcceptedReady for checkin

Left two minor comments on the PR.

Looks ready for checkin otherwise.

Thanks!

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

Resolution: fixed
Status: newclosed

In 0f2ceee0254349ee4ac7d472d3efe67ee161a917:

Fixed #23151 -- Deprecated RegexField.error_message.

Thanks Baptiste Mispelon for the suggestion.

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

In b6ea1961:

Refs #23151 -- Removed RegexField.error_message per deprecation timeline.

comment:5 Changed 15 months ago by Tim Graham <timograham@…>

In afcf44c:

Refs #23151 -- Removed RegexField's unused error_message parameter.

Should have been removed in b6ea1961eb6816dee4370fb0ebd49dba29478db1.

comment:6 Changed 15 months ago by Tim Graham <timograham@…>

In d53fc761:

[1.11.x] Refs #23151 -- Removed RegexField's unused error_message parameter.

Should have been removed in b6ea1961eb6816dee4370fb0ebd49dba29478db1.

Backport of afcf44c10108141e66a8aef0a3cbc151b1c16855 from master

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