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

frontend, python: allow ignoring errors that a project already exists #3085

Merged
merged 1 commit into from
Jan 6, 2024

Conversation

FrostyX
Copy link
Member

@FrostyX FrostyX commented Jan 4, 2024

Fix #2140

@FrostyX
Copy link
Member Author

FrostyX commented Jan 4, 2024

This was much more complicated than I expected.

  • @nikromen Am I doing the query parameters parsing correctly? It was done with the RequestParser but that changed in PR frontend: migrate API projects namespace to flask-restx #2807
  • I am passing the exist_ok value all the way into the CoprUniqueNameValidator and then hackily trying to access its copr instance from the outside. It works but we may want to do it differently? Maybe not using the validator and instead of CoprsLogic.add using CoprsLogic.get_or_create (we have a similar method for CoprDirsLogic)?

@praiskup
Copy link
Member

praiskup commented Jan 5, 2024

otherwise lgtm

@FrostyX
Copy link
Member Author

FrostyX commented Jan 5, 2024

Updated, and I also added a unit test.

Copy link
Member

@praiskup praiskup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@praiskup praiskup merged commit 5f7db52 into main Jan 6, 2024
9 checks passed
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

Successfully merging this pull request may close these issues.

Return the existing project trying to add a project which already exists
2 participants