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

Raise error when model with empty pk field is passed #69

Open
ffigiel opened this issue Sep 22, 2017 · 3 comments
Open

Raise error when model with empty pk field is passed #69

ffigiel opened this issue Sep 22, 2017 · 3 comments

Comments

@ffigiel
Copy link

ffigiel commented Sep 22, 2017

Automated tests in my project failed because it turned out that bulk_update wasn't creating the new model instances I had in the list. I think bulk_update should raise a ValueError saying that it can operate on existing rows only.

@ffigiel
Copy link
Author

ffigiel commented Sep 22, 2017

Looks like #66 is another good take at this.

@jonathan-s
Copy link

If you start using that PR, just beware that it might introduce sql injection vulnerability atm. The values aren't properly escaped. I need to fix that.

@ffigiel
Copy link
Author

ffigiel commented Sep 22, 2017

It's fine, I updated my code to build two lists, one for bulk_update and other for bulk_create. Thanks for the info, this vulnerability stinks.

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