master
Nick Sergeant 2012-04-09 15:19:09 -04:00
parent 7882831c7a
commit 72d05ec717
1 changed files with 3 additions and 3 deletions

View File

@ -40,12 +40,12 @@ class Snipt(models.Model):
def save(self, *args, **kwargs):
if not self.key:
self.key = md5.new(self.slug).hexdigest()
if not self.slug:
self.slug = slugify_uniquely(self.title, Snipt)
if not self.key:
self.key = md5.new(self.slug).hexdigest()
self.stylized = highlight(self.code,
get_lexer_by_name(self.lexer, encoding='UTF-8'),
HtmlFormatter())