Skip to content

Commit

Permalink
Slice to SlugField's default max_length to avoid
Browse files Browse the repository at this point in the history
"value too long for type character varying(50)"
error when slug is too long.
  • Loading branch information
jacobsvante committed May 8, 2011
1 parent cb090ed commit d48f465
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sluggable/models.py
Expand Up @@ -48,7 +48,7 @@ def _generate_slug(self):
# the current value of the "slug" variable is safe to use.
pass

return slug
return slug[0:50]

def _generate_base_slug(self):
"""
Expand Down

0 comments on commit d48f465

Please sign in to comment.