Fixes issue #26 by limiting the slug to the first 50 characters.

This commit is contained in:
Corey Oordt 2011-11-03 09:24:39 -04:00
parent 33ae5fc9c1
commit e0365e8382

View file

@ -41,7 +41,7 @@ class CategoryAdminForm(forms.ModelForm):
def clean_slug(self):
if self.instance is None or not ALLOW_SLUG_CHANGE:
self.cleaned_data['slug'] = slugify(self.cleaned_data['name'])
return self.cleaned_data['slug']
return self.cleaned_data['slug'][:50]
def clean_alternate_title(self):
if self.instance is None or not self.cleaned_data['alternate_title']: