Return a default commit email if migration has not completed

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/51530
This commit is contained in:
Stan Hu 2018-09-15 21:39:02 -07:00
parent a30e266e43
commit 6cdb455314

View file

@ -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