Description
When a pre-enrollment already exists the API returns a 404 status code. This code is not the most appropriate. It should be a 400 status code.
Originally posted by @mariajgrimaldi in #289 (comment)
Possible Solution
The NotFound class by default has this status code:
|
raise NotFound(f'Pre-enrollment already exists for email: {email} course_id: {course_id}') from IntegrityError |
Maybe using the
ValidationError class (
400) in this case is better.