diff options
Diffstat (limited to 'app/controllers/projects/settings/repository_controller.rb')
-rw-r--r-- | app/controllers/projects/settings/repository_controller.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/app/controllers/projects/settings/repository_controller.rb b/app/controllers/projects/settings/repository_controller.rb index 28897cc5946..ab6d8b3b10c 100644 --- a/app/controllers/projects/settings/repository_controller.rb +++ b/app/controllers/projects/settings/repository_controller.rb @@ -55,11 +55,9 @@ module Projects end def define_deploy_token - @deploy_token = @project.deploy_tokens.build(deploy_token_attributes) - end - - def deploy_token_attributes - params.fetch(:deploy_token, {}).permit(:name, :expires_at, scopes: []) + attributes = @deploy_tokens.attributes_deploy_token + @deploy_token = @project.deploy_tokens.build(attributes) + @deploy_token.valid? unless attributes.empty? end end end |