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

kinto lowercase and slugify collection_name and bucket_name #33

Merged
merged 2 commits into from Jan 18, 2016

Conversation

Natim
Copy link
Member

@Natim Natim commented Jan 14, 2016

Trying to create a /buckets/loopClient/collections/en-US collection with kinto.py will create ``/buckets/loopclient/collections/en-us`

@Natim Natim added the bug label Jan 14, 2016
@Natim
Copy link
Member Author

Natim commented Jan 14, 2016

I believe we should use slugify only if the given bucket_name and collection_name doesn't fit the kinto ID format.

@Natim
Copy link
Member Author

Natim commented Jan 14, 2016

r? @almet

@leplatrem
Copy link
Contributor

r+


def slugify(value):
"""Normalizes string, converts to lowercase, removes non-alpha characters
and converts spaces to hyphens.
"""
value = unidecode(six.text_type(value))
value = six.text_type(value)
# Do not lowercase already valid value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean: "do not slugify existing value"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the value are existing :) I mean doesn't distort values that are valid ids.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then you can update this comment :) "Do not slugify valid values"

almet added a commit that referenced this pull request Jan 18, 2016
kinto lowercase and slugify collection_name and bucket_name
@almet almet merged commit afb6fbb into master Jan 18, 2016
@almet almet deleted the do-not-slugify branch January 18, 2016 10:44
@almet almet removed the in progress label Jan 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants