From 7bca902a23d0cccaa3bce422fce7fdc71e722db4 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Wed, 28 Mar 2018 18:54:15 +0200 Subject: Fall back on ghost user when deploy key user is not set --- app/models/deploy_key.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/models/deploy_key.rb') diff --git a/app/models/deploy_key.rb b/app/models/deploy_key.rb index c2e0a5fa126..89a74b7dcb1 100644 --- a/app/models/deploy_key.rb +++ b/app/models/deploy_key.rb @@ -27,6 +27,10 @@ class DeployKey < Key self.private? end + def user + super || User.ghost + end + def has_access_to?(project) deploy_keys_project_for(project).present? end -- cgit v1.2.1