-
Notifications
You must be signed in to change notification settings - Fork 826
[Bug 1132115] Prevent double inserts when using the API to create users. #2367
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
[Bug 1132115] Prevent double inserts when using the API to create users. #2367
Conversation
kitsune/users/tests/test_api.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whaaaaaa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to write @mythmon a pre-commit hook that looks for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrm... I was going to do this, but it turns out to be "hard" without reworking our pre-commit hook to run a directory of hooks so that we can add arbitrary checks in there.
Thoughts on that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've thought about writing that hook too, but it inevitably ends up harder than I want it to be. I think it would be good to have a directory of hooks system eventually, but that is hard and non-standard. Another idea: I think one of pep8, pyflakes, or flake8 supports some sort of plugin interface, which would probably be a good way to make this. I think this is how mccabe works.
Or I could just do better at not committing this...
83270e6 to
1dfdcca
Compare
|
☝️ I force pushed to remove the |
|
yay! works as expected. |
|
@mythmon can't merge |
This is a bit of a hack. It will make moving to DRF 3.0 even more annoying since it is "off the beaten path". However, this behavior is actually more similar (in spirit) to DRF 3.0, so maybe it isn't so bad. It also fixed the bug and unblocks BuddyUp.
r?