forked from 0x2620/pandora
allow longer group names
This commit is contained in:
parent
c317eee9fd
commit
254ad03382
1 changed files with 6 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User, Group
|
||||||
from django.core.validators import MaxLengthValidator
|
from django.core.validators import MaxLengthValidator
|
||||||
|
|
||||||
#load config from json
|
#load config from json
|
||||||
|
@ -18,5 +18,10 @@ def monkey_patch_username():
|
||||||
for v in f.validators:
|
for v in f.validators:
|
||||||
if isinstance(v, MaxLengthValidator):
|
if isinstance(v, MaxLengthValidator):
|
||||||
v.limit_value = NEW_LENGTH[field]
|
v.limit_value = NEW_LENGTH[field]
|
||||||
|
f= Group._meta.get_field('name')
|
||||||
|
f.max_length = 255
|
||||||
|
for v in f.validators:
|
||||||
|
if isinstance(v, MaxLengthValidator):
|
||||||
|
v.limit_value = 255
|
||||||
|
|
||||||
monkey_patch_username()
|
monkey_patch_username()
|
||||||
|
|
Loading…
Reference in a new issue