summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-01-05 16:40:23 +0100
committerDouwe Maan <douwe@gitlab.com>2016-01-05 16:40:23 +0100
commitfd91b48f24d9f9d5e8f357b7b5324d279ce41077 (patch)
treecfa6e79e3bdbfde4b67b7bc549b6c3548a66bdaf /app/services
parent7dedd997b910f65ee3c494d906fbc2392962c114 (diff)
parent7c3c901ada6fc4a6d2d3ce7a2cf8188cf6615008 (diff)
downloadgitlab-ce-fd91b48f24d9f9d5e8f357b7b5324d279ce41077.tar.gz
Merge branch 'master' into milestone-ref
Diffstat (limited to 'app/services')
-rw-r--r--app/services/notification_service.rb1
-rw-r--r--app/services/projects/transfer_service.rb3
-rw-r--r--app/services/system_hooks_service.rb11
3 files changed, 14 insertions, 1 deletions
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb
index bdf7b3ad2bb..e4edc55bf69 100644
--- a/app/services/notification_service.rb
+++ b/app/services/notification_service.rb
@@ -413,6 +413,7 @@ class NotificationService
recipients = reject_unsubscribed_users(recipients, target)
recipients.delete(current_user)
+ recipients = recipients.uniq
recipients
end
diff --git a/app/services/projects/transfer_service.rb b/app/services/projects/transfer_service.rb
index 64ea6dd42eb..2e734654466 100644
--- a/app/services/projects/transfer_service.rb
+++ b/app/services/projects/transfer_service.rb
@@ -55,6 +55,9 @@ module Projects
# Move uploads
Gitlab::UploadsTransfer.new.move_project(project.path, old_namespace.path, new_namespace.path)
+ project.old_path_with_namespace = old_path
+
+ SystemHooksService.new.execute_hooks_for(project, :transfer)
true
end
end
diff --git a/app/services/system_hooks_service.rb b/app/services/system_hooks_service.rb
index 8b5143e1eb7..6dc854ec33d 100644
--- a/app/services/system_hooks_service.rb
+++ b/app/services/system_hooks_service.rb
@@ -18,7 +18,8 @@ class SystemHooksService
def build_event_data(model, event)
data = {
event_name: build_event_name(model, event),
- created_at: model.created_at.xmlschema
+ created_at: model.created_at.xmlschema,
+ updated_at: model.updated_at.xmlschema
}
case model
@@ -34,6 +35,14 @@ class SystemHooksService
end
when Project
data.merge!(project_data(model))
+
+ if event == :rename || event == :transfer
+ data.merge!({
+ old_path_with_namespace: model.old_path_with_namespace
+ })
+ end
+
+ data
when User
data.merge!({
name: model.name,