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

.upper() key in call to get_or_create #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mjhanke
Copy link

@mjhanke mjhanke commented Sep 7, 2018

In KeyValueStore.save() you .upper() the key field. This doesn't happen when set_key_value calls KeyValueStore.objects.get_or_create(key=key, defaults={'value': value}). The standard models.Manager.get_or_create will check for the non-.upper() field, return that it doesn't have that saved, and then call the KeyValueStore.save() method, which will then fail.

Steps to repro:
call set_key_value('cheese', 'cheesier') two times in a row.

Micaiah Hanke added 3 commits September 7, 2018 14:48
`get_or_create` IntegrityError bug fix

See merge request mst/django-keyvaluestore!1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant