From: Christopher Allan Webber Date: Wed, 23 Jan 2013 22:40:39 +0000 (-0600) Subject: We don't want any empty string slugs, so make "" -> None X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b0118957ff3304226f3500b4f5cfaecc41e9ee48;p=mediagoblin.git We don't want any empty string slugs, so make "" -> None --- diff --git a/mediagoblin/db/mixin.py b/mediagoblin/db/mixin.py index c4c508a4..98414d72 100644 --- a/mediagoblin/db/mixin.py +++ b/mediagoblin/db/mixin.py @@ -89,6 +89,10 @@ class MediaEntryMixin(object): # assign slug based on title self.slug = slugify(self.title) + # We don't want any empty string slugs + if self.slug == u"": + self.slug = None + # Do we have anything at this point? # If not, we're not going to get a slug # so just return... we're not going to force one.