From 838be660ec499930e60ab98ace6a697b9a652442 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 20 Nov 2012 09:55:39 +0100 Subject: [PATCH] shorten slug when submitting entry --- migdal/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migdal/forms.py b/migdal/forms.py index 7c93ea8..63eba61 100644 --- a/migdal/forms.py +++ b/migdal/forms.py @@ -34,7 +34,7 @@ def get_submit_form(*args, **kwargs): def clean(self): data = super(SubmitForm, self).clean() data['type'] = app_settings.TYPE_SUBMIT - orig_slug = slughifi(data.get('title_%s' % lang, '')) + orig_slug = slughifi(data.get('title_%s' % lang, ''))[:47] slug = orig_slug number = 2 while Entry.objects.filter(**{'slug_%s' % lang: slug}).exists(): -- 2.20.1