Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Hollingsworth <jhworth.developer@gmail.com>2014-02-09 07:08:49 +0400
committerJason Hollingsworth <jhworth.developer@gmail.com>2014-02-14 08:59:39 +0400
commit29cfd33d949d21d67f3892473c24d4f0a127dfe6 (patch)
treee9ed4a10e06f7eba224150a643cb87507fc2ddc7 /app/services
parentd41e404e09c79394ff1938eee01b56345edc6ed9 (diff)
Add email aliases for users
Emails are used to associate commits with users. The emails are not verified and don't have to be valid email addresses. They are assigned on a first come, first serve basis. Notifications are sent when an email is added.
Diffstat (limited to 'app/services')
-rw-r--r--app/services/git_push_service.rb4
-rw-r--r--app/services/notification_service.rb7
2 files changed, 8 insertions, 3 deletions
diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb
index e54f88e42de..fcc03c3e4b8 100644
--- a/app/services/git_push_service.rb
+++ b/app/services/git_push_service.rb
@@ -188,8 +188,6 @@ class GitPushService
end
def commit_user commit
- User.where(email: commit.author_email).first ||
- User.where(name: commit.author_name).first ||
- user
+ User.find_for_commit(commit.author_email, commit.author_name) || user
end
end
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb
index 7c02777e914..9d7bb9639ac 100644
--- a/app/services/notification_service.rb
+++ b/app/services/notification_service.rb
@@ -17,6 +17,13 @@ class NotificationService
end
end
+ # Always notify user about email added to profile
+ def new_email(email)
+ if email.user
+ mailer.new_email_email(email.id)
+ end
+ end
+
# When create an issue we should send next emails:
#
# * issue assignee if their notification level is not Disabled