Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUGGESTION: slug generation -> don't allow apostrophes, commas, etc. #4

Open
jaradc opened this issue Dec 1, 2022 · 1 comment
Open

Comments

@jaradc
Copy link

jaradc commented Dec 1, 2022

Just a suggestion. I am using this package for generating dummy Django text. Because this package allows slugs like:

bas'-The-jorthe-of-val-lected
2005)-sethe-cat-mand-two8-onts
Egy.652369-pealti18-sq
in.-beis-ch

Django throws errors. Example error:

django.urls.exceptions.NoReverseMatch: Reverse for 'service_detail' with keyword arguments '{'username': 'admin', 'topic1': 'general', 'pk': 9, 'slug': "bas'-The-jorthe-of-val-lected"}' not found.

My knit-pick suggestion is to add argument to the slug generator to exclude punctuation and make it all lowercase. Simple for me to do but from a package-perspective, this could benefit your package and help more than just me. I don't know why anyone would want upper-case and punctuation in slugs but I'd argue that is not the most-common use-case.

@shane-mason
Copy link
Owner

This is a good suggestion - will update.

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

No branches or pull requests

2 participants