#17763: Problem with auth_permission name length
------------------------------+-------------------------------------
Reporter: stenius@… | Owner: anonymous
Type: Bug | Status: assigned
Component: contrib.auth | Version: 1.3
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
------------------------------+-------------------------------------
Comment (by ricw):
The problem is with regards to the "name" field, not the codename field
(as described above). The codename field will be populated by a smaller
string than the name field, as it is the same length minus whitespace and
descriptive characters (e.g. "Can add"/"Can modify"/..). So the setup
should take this into consideration such that len(name)>len(codename).
Currently the opposite is the case (excerpt from contrib.auth.models).
{{{
class Permission(models.Model):
..
name = models.CharField(_('name'), max_length=50)
..
codename = models.CharField(_('codename'), max_length=100)
..
}}}
Two options here:
1. name length should be increased to at least 120 to accommodate for
potential white space and additional info (e.g. "Can change"/"Can
delete"/"Can add"..) that it stores when compared to codename.
2. Cut the length down to 50 when initialising the model.
Currently it is failing for me because this model name is too long: "Can
change material variant distributor region country"
This is only length 54. I wouldn't say that the length is excessively
long. It should certainly be supported by django.
--
Ticket URL: <https://code.djangoproject.com/ticket/17763#comment:4>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.