Don't notify user for deploy keys, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_18517263
This commit is contained in:
		
							parent
							
								
									a8a879eebc
								
							
						
					
					
						commit
						2489332297
					
				|  | @ -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 | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue