We don't want any empty string slugs, so make "" -> None
authorChristopher Allan Webber <cwebber@dustycloud.org>
Wed, 23 Jan 2013 22:40:39 +0000 (16:40 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Wed, 23 Jan 2013 22:40:39 +0000 (16:40 -0600)
mediagoblin/db/mixin.py

index c4c508a417cbb089ee1a5021d19954255db488ae..98414d729f8f29c6339c77b2c3adfeaac974c815 100644 (file)
@@ -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.