-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
API V3 Subproject Creation Bug fix #6275
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
Conversation
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.
Changes look good. I'm leaving some suggestions to have more explicit tests. Also, I'm pushing some tests for the UI form, I was in the process of fixing this when I saw this PR p:
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.
Oh, and looks like all validation errors from the subproject serializer are missing i18n, can you add it?
Co-Authored-By: Santos Gallegos <[email protected]>
Co-Authored-By: Santos Gallegos <[email protected]>
Sure thanks :)
Okay :) |
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 was almost sure that I was going to make a mistake with this logic. I'm happy that you solved the issue. Thanks!
When working on this, I asked myself if it wouldn't be better to move the logic outside the Form and share it with the Serializer. After the bug that I introduced, I'd say it's clear that we have to do that instead of replicating the same logic. I want a function is_valid_as_subproject(project, subproject)
raising different customized exceptions that we can handle properly on the Form and Serializer.
I think we can have 2 methods that will check Should I update this PR with that or Its alright for now? But not sure how to raise different customized exceptions that we can handle properly on the Form and Serializer without any hack. like passing the validation error class |
Two methods are more explicit to me.
I think this refactor can be done in another PR. Do you want to work on that as well? |
@humitos Sure! 👍 I'll send a PR Soon |
fixes: #6271