Skip to content
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.

Slug validation missing #62

Closed
gpoulin opened this issue Jun 18, 2014 · 3 comments
Closed

Slug validation missing #62

gpoulin opened this issue Jun 18, 2014 · 3 comments

Comments

@gpoulin
Copy link

gpoulin commented Jun 18, 2014

When a slug is provided during the creation of a post, the validity of the slug is not verify. For example, if the slug contain space or commas I'm getting:

NoReverseMatch: Reverse for 'post-detail' with arguments '()' and
keyword arguments '{'year': 2014, 'slug': u'dummy, foo, bar', 'day': 8,
'month': 5}' not found. 1 pattern(s) tried: [u'en/blog/(?P<year>\\d{4})/
(?P<month>\\d{1,2})/(?P<day>\\d{1,2})/(?P<slug>\\w[-\\w]*)/$']

In addition, if the slug is not provided and the title doesn't contain any valid character (Cyrillic/Chinese/Arab... title) the slug created is an empty string and the same bug occur.

I can try to provide a pull request, this weekend.

@adrien-delhorme
Copy link

And if the slug is left empty and there already is a page with a similar slug, an IntegrityError is raised:

IntegrityError: duplicate key value violates unique constraint "aldryn_blog_post_slug_key"

@czpython
Copy link
Contributor

Fixed by 885e897

@czpython
Copy link
Contributor

@adrien-delhorme I've opened ticket #79 to track this bug. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants