BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
24893322
Commit
24893322
authored
Nov 18, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't notify user for deploy keys, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_18517263
parent
a8a879ee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
deploy_keys_controller.rb
app/controllers/admin/deploy_keys_controller.rb
+1
-1
deploy_key.rb
app/models/deploy_key.rb
+6
-0
key.rb
app/models/key.rb
+4
-4
No files found.
app/controllers/admin/deploy_keys_controller.rb
View file @
24893322
...
...
@@ -10,7 +10,7 @@ class Admin::DeployKeysController < Admin::ApplicationController
end
def
create
@deploy_key
=
deploy_keys
.
new
(
deploy_key_params
)
@deploy_key
=
deploy_keys
.
new
(
deploy_key_params
.
merge
(
user:
current_user
)
)
if
@deploy_key
.
save
redirect_to
admin_deploy_keys_path
...
...
app/models/deploy_key.rb
View file @
24893322
...
...
@@ -28,4 +28,10 @@ class DeployKey < Key
def
can_push_to?
(
project
)
can_push?
&&
has_access_to?
(
project
)
end
private
# we don't want to notify the user for deploy keys
def
notify_user
end
end
app/models/key.rb
View file @
24893322
...
...
@@ -49,10 +49,6 @@ class Key < ActiveRecord::Base
)
end
def
notify_user
run_after_commit
{
NotificationService
.
new
.
new_key
(
self
)
}
end
def
post_create_hook
SystemHooksService
.
new
.
execute_hooks_for
(
self
,
:create
)
end
...
...
@@ -78,4 +74,8 @@ class Key < ActiveRecord::Base
self
.
fingerprint
=
Gitlab
::
KeyFingerprint
.
new
(
self
.
key
).
fingerprint
end
def
notify_user
run_after_commit
{
NotificationService
.
new
.
new_key
(
self
)
}
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment