#26470: Checks performed during Permission creation should use the check
framework.
------------------------------------------------+------------------------
Reporter: charettes | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.auth | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
The `django.contrib.auth.management.check_permission` function that is
connected to the `post_migrate` signal performs static model analysis
checks that should rely on the check framework. At the moment a
`ValidationError` or a `CommandError` is raised when a check fails.
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.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.0fa1d5015968b0c9055482efa52a0b05%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.