aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2013-01-23 16:40:39 -0600
committerChristopher Allan Webber <cwebber@dustycloud.org>2013-01-23 16:40:39 -0600
commitb0118957ff3304226f3500b4f5cfaecc41e9ee48 (patch)
treef487631882ca424681fe7974d7b30258eed39f6c
parent266b42b3dc7697801f726875e1a734b9e4ba7dc9 (diff)
downloadmediagoblin-b0118957ff3304226f3500b4f5cfaecc41e9ee48.tar.lz
mediagoblin-b0118957ff3304226f3500b4f5cfaecc41e9ee48.tar.xz
mediagoblin-b0118957ff3304226f3500b4f5cfaecc41e9ee48.zip
We don't want any empty string slugs, so make "" -> None
-rw-r--r--mediagoblin/db/mixin.py4
1 files changed, 4 insertions, 0 deletions
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.