projects
/
oweals
/
karmaworld.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f9521cb
)
Fix slug generation to prevent collisions.
author
Josh Williams
<jwilliams@endpoint.com>
Mon, 30 Sep 2013 21:36:38 +0000
(17:36 -0400)
committer
Josh Williams
<jwilliams@endpoint.com>
Mon, 30 Sep 2013 21:36:38 +0000
(17:36 -0400)
karmaworld/apps/notes/models.py
patch
|
blob
|
history
diff --git
a/karmaworld/apps/notes/models.py
b/karmaworld/apps/notes/models.py
index 56446494978e7de54a23c39be7be87092fd007df..536513063e4249fa11c12d490329e809fe9795a3 100644
(file)
--- a/
karmaworld/apps/notes/models.py
+++ b/
karmaworld/apps/notes/models.py
@@
-76,7
+76,7
@@
class Document(models.Model):
""" generate a unique slug based on name and uploaded_at """
_slug = defaultfilters.slugify(self.name)
klass = self.__class__
- collision = klass.objects.filter(slug=
self.
slug)
+ collision = klass.objects.filter(slug=
_
slug)
if collision:
_slug = u"{0}-{1}-{2}-{3}".format(
_slug, self.uploaded_at.month,