From 90f0b42654bd029c66966f0a2d1494020ec30c2e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20K=C3=B6gl?= Date: Wed, 27 Aug 2014 15:49:47 +0000 Subject: [PATCH] [Podcasts] trim new slugs to maximum length --- mygpo/podcasts/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mygpo/podcasts/models.py b/mygpo/podcasts/models.py index a23d5e1b..49158b6a 100644 --- a/mygpo/podcasts/models.py +++ b/mygpo/podcasts/models.py @@ -203,6 +203,9 @@ class SlugsMixin(models.Model): existing_slugs = self.slugs.all() + # cut slug to the maximum allowed length + slug = utils.to_maxlength(Slug, 'slug', slug) + # check if slug already exists if slug in [s.slug for s in existing_slugs]: return -- 2.11.4.GIT