The checks performed are the following:
1. Check that custom permissions don't clash with built-ins and are not
duplicated;
2. Check that models `verbose_name` doesn't exceed a certain length based
on the `Permission.name.max_length`;
3. Check that permissions `name` doesn't exceed a certain length based on
the `Permission.name.max_length`.
For `2.` and `3.` I suggest we make them issue a `check.Warning` with a
message noting that the name will be truncated to N characters instead of
crashing with an `IntegrityError` if the check is ignored/disabled.
--
Ticket URL: <https://code.djangoproject.com/ticket/26470>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* has_patch: 0 => 1
Comment:
https://github.com/django/django/pull/6421
--
Ticket URL: <https://code.djangoproject.com/ticket/26470#comment:1>
* stage: Unreviewed => Ready for checkin
Comment:
Those checks were added before the permission name `max_length` was
increased from 50 to 255 (#8162). Therefore I expect few if any users to
exceed that limit these days. I don't see much benefit to adding
truncation logic as proposed.
--
Ticket URL: <https://code.djangoproject.com/ticket/26470#comment:2>
* needs_better_patch: 0 => 1
* stage: Ready for checkin => Accepted
Comment:
Alright, I'll add them as errors later today in this case.
--
Ticket URL: <https://code.djangoproject.com/ticket/26470#comment:3>
Comment (by charettes):
Just ported the permission names max length checks as well.
--
Ticket URL: <https://code.djangoproject.com/ticket/26470#comment:4>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/26470#comment:5>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/26470#comment:6>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"a872194802c2bacb067c2b9c9cb76361e2071c0f" a872194]:
{{{
#!CommitTicketReference repository=""
revision="a872194802c2bacb067c2b9c9cb76361e2071c0f"
Fixed #26470 -- Converted auth permission validation to system checks.
Thanks Tim for the review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26470#comment:7>