From: Bryan Bonvallet Date: Tue, 13 Jan 2015 19:27:19 +0000 (-0500) Subject: #388 ensure self.slug is not the empty string X-Git-Tag: release-20150131~6 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2bdcc915915388deb24332995aa9d5ad2ec65ec3;p=oweals%2Fkarmaworld.git #388 ensure self.slug is not the empty string --- diff --git a/karmaworld/apps/notes/models.py b/karmaworld/apps/notes/models.py index 8710af7..c6c2a52 100644 --- a/karmaworld/apps/notes/models.py +++ b/karmaworld/apps/notes/models.py @@ -299,7 +299,7 @@ class Note(Document): """ Resolve note url, use 'note' route and slug if slug otherwise use note.id """ - if self.slug is not None: + if self.slug: # return a url ending in slug if self.course.school: return reverse('note_detail', args=[self.course.school.slug, self.course.slug, self.slug])