-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
raise HTTP 400 on IntegrityError during Clone #862
base: main
Are you sure you want to change the base?
Conversation
Same behavior as for schedule creation (that API supports but UI does not)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A test case is probably easy to add + would be beneficial.
try: | ||
session.flush() | ||
except IntegrityError: | ||
raise BadRequest("Schedule name already exists") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this a bit risky, I'm afraid we might have other integrity constraints in the future and might forget to alter this message.
At least I would log a warning with the exact integrity issue so that we can discover this in the log, otherwise it will be difficult to debug.
Or I would analyze IntegrityError, check the issue is about the schedule name, raise this BadRequest only in this situation ; and raise a more generic IntegrityError for other situations (which do not exist today).
@benoit74 This is a very old PR, it would be good to consoder to treat it |
We should probably close it. I think it was open in reaction to something that's not that important now |
Issue is sill valid |
I think issue is still valid, and feedback has been provided in the review (quite minor, but still important). At this point I expected @rgaudin to finish the PR since he started the job. I don't mind to finish it if it is more appropriate. |
@benoit74 please take over |
Fixes #844