Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Always regenerate slug on save

  • Loading branch information...
commit e11b84e4dd5ff0e8eb99b7c38b0becab748a3224 1 parent d48f465
@jmagnusson authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/sluggable/models.py
View
5 src/sluggable/models.py
@@ -61,9 +61,8 @@ def _generate_base_slug(self):
return slugify(u'%s' % self)
def save(self, *args, **kwargs):
- if self.slug is None or self.slug == '':
- self.slug = self._generate_slug()
-
+ self.slug = self._generate_slug()
+
return super(SluggableModel, self).save(*args, **kwargs)
class Meta:
Please sign in to comment.
Something went wrong with that request. Please try again.