From 6cdb45531486c8b3dd997cc97549f84b11e8954e Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sat, 15 Sep 2018 21:39:02 -0700 Subject: [PATCH] Return a default commit email if migration has not completed Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/51530 --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index d68108a8e8e..7298f88e54c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -635,7 +635,7 @@ class User < ActiveRecord::Base # possibility of the commit_email column not existing. def commit_email - return unless has_attribute?(:commit_email) + return self.email unless has_attribute?(:commit_email) # The commit email is the same as the primary email if undefined super.presence || self.email