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

Using the createRecipe API results in created_by_id violating not-null constraint #296

Closed
lipschultz opened this issue Dec 30, 2020 · 0 comments · Fixed by #297
Closed

Comments

@lipschultz
Copy link
Contributor

Version

Please provide your current version (can be found on the system page since v0.8.4)
Version: 0.12.1

Bug description

Importing a recipe using the API results in an IntegrityError: null value in column "created_by_id" violates not-null constraint.

It looks like this bug could be part of #108, but I'm not sure.

Steps to Reproduce

To make sure I had the json and permissions correct, I used the API to get a recipe imported via the web:

curl --user "USERNAME:PASSWORD" -X GET 'http://localhost:8080/api/recipe/1/'

I then removed some fields from the json to conform to the createRecipe spec: retrieved-recipe.json

Attempting to add it via the API:

curl --user "USERNAME:PASSWORD" -X POST 'http://localhost:8080/api/recipe/' -H "Content-Type: application/json" -d @retrieved-recipe.json

Resulted in an html response indicating the integrity error mentioned above: response.html

The top of the response was:

IntegrityError at /api/recipe/

null value in column "created_by_id" violates not-null constraint
DETAIL:  Failing row contains (2, API-entered Savory Sausage Cups, , , null, 30, t, 2020-12-30 15:59:22.505224+00, 2020-12-30 15:59:22.505245+00, null, null, , 20, null, null).
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 a pull request may close this issue.

1 participant