diff options
Diffstat (limited to 'app/presenters/projects/settings/deploy_tokens_presenter.rb')
-rw-r--r-- | app/presenters/projects/settings/deploy_tokens_presenter.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/app/presenters/projects/settings/deploy_tokens_presenter.rb b/app/presenters/projects/settings/deploy_tokens_presenter.rb index cbad35431b3..bdb89bb9f02 100644 --- a/app/presenters/projects/settings/deploy_tokens_presenter.rb +++ b/app/presenters/projects/settings/deploy_tokens_presenter.rb @@ -23,14 +23,23 @@ module Projects end end - def new_deploy_token - @new_deploy_token ||= Gitlab::Redis::SharedState.with do |redis| + def temporal_token + @temporal_token ||= Gitlab::Redis::SharedState.with do |redis| token = redis.get(deploy_token_key) redis.del(deploy_token_key) token end end + def attributes_deploy_token + @attributes_deploy_token ||= Gitlab::Redis::SharedState.with do |redis| + attributes_key = deploy_token_key + ":attributes" + attributes_content = redis.get(attributes_key) || '{}' + redis.del(attributes_key) + JSON.parse(attributes_content) + end + end + private def scope_descriptions @@ -41,7 +50,7 @@ module Projects end def deploy_token_key - DeployToken.redis_shared_state_key(current_user.id) + @deploy_token_key ||= project.deploy_tokens.new.redis_shared_state_key(current_user.id) end end end |