diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-09 12:09:53 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-09 12:09:53 +0300 |
commit | 1613500bf7400f5692a55fd65235a4a10fc40a7d (patch) | |
tree | 967ae692bf524c89abdde048d8f74361642293c7 /app/services/keys | |
parent | 97576e3dfdc15b26c0a7832608397edd69167351 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/keys')
-rw-r--r-- | app/services/keys/destroy_service.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/services/keys/destroy_service.rb b/app/services/keys/destroy_service.rb index eaf5eb35f58..c7ebb484e94 100644 --- a/app/services/keys/destroy_service.rb +++ b/app/services/keys/destroy_service.rb @@ -3,14 +3,22 @@ module Keys class DestroyService < ::Keys::BaseService def execute(key) - key.destroy if destroy_possible?(key) + return unless destroy_possible?(key) + + destroy(key) end + private + # overridden in EE::Keys::DestroyService def destroy_possible?(key) true end + + def destroy(key) + key.destroy + end end end -Keys::DestroyService.prepend_mod_with('Keys::DestroyService') +Keys::DestroyService.prepend_mod |