Insert broken when there's not primary key #3246
Labels
ready
Ready for implementation
type: bug
Something isn't working
work: backend
Related to Python, Django, and simple SQL
Milestone
Description
When a table does not have a primary key, attempting to use the UI to create a new record results in the backend throwing an unhandled 500 error.
Expected behavior
When a
POST
request representing a new empty record is sent for a table with no primary key, the server should respond with a 405 error, since we can't allow creating (or editing) rows on tables with no primary key. The error should be associated with some informationalAPIException
stating that you can't insert into tables without a primary key.The implementer should add an API test to validate their solution.
To Reproduce
+
to add a record.tuple index out of range
error in the devtools.The text was updated successfully, but these errors were encountered: