Skip to content

Avoids collisions in choices names conversion. #86

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

Merged

Conversation

pchinea
Copy link

@pchinea pchinea commented Jan 5, 2017

When a django field with choices is converted to an enum and the choices names are normalized, two or more names could be normalized to the same name producing a collision. For example: "Etc/GMT+1" and "Etc/GMT-1" will be converted to "ETC_GMT_1". This patch avoids collisions generating a new unique name when a collision is produced.

@coveralls
Copy link

coveralls commented Jan 5, 2017

Coverage Status

Coverage increased (+0.04%) to 92.478% when pulling 2c26774 on gamingexperience:fix/field-choices-collision into 4246cea on graphql-python:master.

@coveralls
Copy link

coveralls commented Jan 5, 2017

Coverage Status

Coverage increased (+0.04%) to 92.478% when pulling 89d0f0c on gamingexperience:fix/field-choices-collision into 4246cea on graphql-python:master.

@fmartins-in-loggi
Copy link

Hey buddies!
This PR solves a problem that I am facing...
Thank you @pchinea

@syrusakbary syrusakbary merged commit 03f3fbe into graphql-python:master Jan 15, 2017
@pchinea pchinea deleted the fix/field-choices-collision branch February 23, 2017 14:19
@jeffbr13
Copy link

jeffbr13 commented Mar 1, 2017

Thank you @pchinea, this fixes a problem that I was having with pytz TimezoneFields as well!

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

Successfully merging this pull request may close these issues.

5 participants