Opened 6 years ago
Closed 6 years ago
#29939 closed Cleanup/optimization (fixed)
Increase Group.name max_length from 80 to 150
Reported by: | John Piotrowski | Owned by: | Timothy Allen |
---|---|---|---|
Component: | contrib.auth | Version: | 2.1 |
Severity: | Normal | Keywords: | Group, Name, MaxLength |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
Right now the default authorization model has Group with a name field of 80. I recently ran into an issue where my group name is longer than 80 and it just causes Django to error and fail. We use Grouper so the naming schema can be very long and i would think this would be a non-breaking change to just increase the model from Maxlength of 80 to 255.
Change History (5)
comment:1 by , 6 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Type: | Bug → Cleanup/optimization |
comment:2 by , 6 years ago
Has patch: | set |
---|
Patch has been issued as a PR: https://github.com/django/django/pull/10627
comment:3 by , 6 years ago
Needs tests: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
This request looks reasonable. Although I am not sure about the max_length to be 191.
comment:4 by , 6 years ago
Needs tests: | unset |
---|---|
Summary: | Change the length of the Group Name from 80 to something much higher like 255 → Increase Group.name max_length from 80 to 150 |
Triage Stage: | Accepted → Ready for checkin |
The django-developers discussion yielded a consensus to increase the max_length to 150 like the User.username
and User.last_name
fields.
I believe it would be reasonable to increase the max_length to 191, to be consistent with recent changes to other fields such as
username
on thedjango.contrib.auth
user model. The 191 character limit is a MySQL limitation for indexing. I will take a shot at making a patch.