[Django] #30757: Add check to ensure max_length fits longest choice.

4 views
Skip to first unread message

Django

unread,
Sep 4, 2019, 4:27:03 AM9/4/19
to django-...@googlegroups.com
#30757: Add check to ensure max_length fits longest choice.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: | Status: assigned
Cleanup/optimization |
Component: Core | Version: master
(System checks) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
There is currently no check to ensure that `Field.max_length` is large
enough to fit the longest value in `Field.choices`.

This would be very helpful as often this mistake is not noticed until an
attempt is made to save a record with those values that are too long.

--
Ticket URL: <https://code.djangoproject.com/ticket/30757>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 4, 2019, 4:30:35 AM9/4/19
to django-...@googlegroups.com
#30757: Add check to ensure max_length fits longest choice.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: | Status: assigned
Cleanup/optimization |
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nick Pope):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/11742 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/30757#comment:1>

Django

unread,
Sep 4, 2019, 4:36:09 AM9/4/19
to django-...@googlegroups.com
#30757: Add check to ensure max_length fits longest choice.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: | Status: assigned
Cleanup/optimization |
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/30757#comment:2>

Django

unread,
Sep 9, 2019, 4:51:11 AM9/9/19
to django-...@googlegroups.com
#30757: Add check to ensure max_length fits longest choice.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: | Status: closed

Cleanup/optimization |
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"b6251956b69512bf230322bd7a49b629ca8455c6" b6251956]:
{{{
#!CommitTicketReference repository=""
revision="b6251956b69512bf230322bd7a49b629ca8455c6"
Fixed #30757 -- Added a system check to ensure max_length fits the longest
choice.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30757#comment:3>

Reply all
Reply to author
Forward
0 new messages