500 Internal Server Error when enabling a deploy key more than once through API
Summary
When I try to enable a deploy key for a project more than once through the API, every subsequent call after the first returns a 500 error.
Steps to reproduce
- Crate a deploy key named
FOO
inRepository A
- In
Repository B
:curl --request POST --header "PRIVATE-TOKEN: ${PRIVATE_TOKEN}" "https://gitlab.com/api/v3/projects/<Repository B Id>/deploy_keys/<Deploy Key Foo Id>/enable"
(Works fine) - Repeat 2. (Returns 500)
What is the current bug behaviour?
Doesn't change behaviour, just 500 is/was unexpected
What is the expected correct behaviour?
Something along the lines of a 201 or 304
Possible fixes
No impact, just API response was unexpected
Environment
gitlab.com