django.core.exceptions.ValidationError: ["The verbose_name of
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX is longer than 39 characters"]
I think that could be checked among other model validations.
--
Ticket URL: <https://code.djangoproject.com/ticket/23480>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Validation for `verbose_name` was added in #18866, could you clarify if
something additional is needed (in what cases is the database error
raised)?
--
Ticket URL: <https://code.djangoproject.com/ticket/23480#comment:1>
* status: new => closed
* resolution: => needsinfo
--
Ticket URL: <https://code.djangoproject.com/ticket/23480#comment:2>
* status: closed => new
* resolution: needsinfo =>
Comment:
If I understand correctly, the complaint is not about a database error,
but about this validation happening only when the permissions are created
(that is, when the models are created in the database), rather than as a
check in the check framework (which would happen sooner and make fixing
easier).
Adding this as a check to django.contrib.auth makes sense to me, but I
leave it to people more intimate with django.contrib.auth to accept or
reject the ticket.
--
Ticket URL: <https://code.djangoproject.com/ticket/23480#comment:3>
* status: new => closed
* resolution: => wontfix
Comment:
The only point where there's an arbitrary restriction on the length of
`verbose_name` is during the creation of permissions. We should lift that
restriction when we start adding migrations to contrib apps. At that point
we'll simply stop raising an exception when hitting the limit.
That's why I believe the current level of error reporting is appropriate.
--
Ticket URL: <https://code.djangoproject.com/ticket/23480#comment:4>
Comment (by timgraham):
Just to close the loop, the `max_length` of `Permission.name` was
increased to 255 characters in #8162 so the `verbose_name` limit is
effectively 244 characters.
--
Ticket URL: <https://code.djangoproject.com/ticket/23480#comment:5>