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

API return 404 when a pre-enrollment already exists #291

Open
BryanttV opened this issue Oct 18, 2024 · 0 comments
Open

API return 404 when a pre-enrollment already exists #291

BryanttV opened this issue Oct 18, 2024 · 0 comments

Comments

@BryanttV
Copy link
Contributor

BryanttV commented Oct 18, 2024

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.

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

1 participant