diff options
author | Robert Speicher <robert@gitlab.com> | 2015-12-29 22:14:36 +0000 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-12-30 16:49:10 -0500 |
commit | 8d8f52ac17c7a8f9ec82b818b6097366e9aff329 (patch) | |
tree | 0bc37159e7583a4c864aca9aecadf3440f02b2ee | |
parent | db29304068d7ab0aee3c58972c05a20817bbd8da (diff) | |
download | gitlab-ce-8d8f52ac17c7a8f9ec82b818b6097366e9aff329.tar.gz |
Merge branch 'fix-transfer-project-email' into 'master'
Fix project transfer e-mail sending incorrect paths in e-mail notification
The introduction of ActiveJob and `deliver_now` in 7f214cee7 caused a race
condition where the mailer would be invoked before the project was committed
to the database, causing the transfer e-mail notification to show the old
path instead of the new one.
Closes #4670
See merge request !2235
-rw-r--r-- | CHANGELOG | 3 | ||||
-rw-r--r-- | app/models/project.rb | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG index 61009521bbf..8cd9f342bf3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ Please view this file on the master branch, on stable branches it's out of date. +v 8.3.3 (unreleased) + - Fix project transfer e-mail sending incorrect paths in e-mail notification (Stan Hu) + v 8.3.2 - Disable --follow in `git log` to avoid loading duplicate commit data in infinite scroll (Stan Hu) - Add support for Google reCAPTCHA in user registration diff --git a/app/models/project.rb b/app/models/project.rb index b28a7ca429c..a8f69fd1eec 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -539,7 +539,9 @@ class Project < ActiveRecord::Base end def send_move_instructions(old_path_with_namespace) - NotificationService.new.project_was_moved(self, old_path_with_namespace) + # New project path needs to be committed to the DB or notification will + # retrieve stale information + run_after_commit { NotificationService.new.project_was_moved(self, old_path_with_namespace) } end def owner |