Session gets created in db even when request error response
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 52
- Forks
- 12
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 4
Description
Reporting what I believe is a bug:
when trying to POST a new session (on a python script), I passed a dictionary like this in the data field of the request:
data = { "subject": "subject2"}
This returns a HTTP error, and that’s because I was missing the users list. However, the Session gets created in the database, with an empty list of users!
Now, is that the expected behavior? If I get a http error from my POST request, I wouldn’t expect the POST to be successful.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Django endpoint that handles POST requests for creating sessions, then inspect how validation errors and database writes are sequenced. Reproduce the request with only the subject field and check whether the failed response leaves a Session record; done means the error response does not persist a new session, with a regression test covering the case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- api, backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100