Fixes various errors when adding deploy keys caused by not exiting the control flow.
When adding a deploy key that already exists in the project the existing key would not be returned, resulting in an attempt to create a new one, which in turn caused a 500 error due to an ActiveRecord exception.
When adding a deploy key that exists within another project the key would be joined to the project, but would also attempt to create a new one, which resulted in a 400 error due to the key already existing.
Fixes #22741
Fixes #21754
Signed-off-by: Rémy Coutable <remy@rymai.me>
Showing
Please register or sign in to comment