summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-10-01 12:36:00 +0200
committerDouwe Maan <douwe@gitlab.com>2015-10-01 12:36:00 +0200
commitd8b71ed83e28666286afc4211e0e6ef603fbfe1b (patch)
tree9b0267cf378a0d83c37fa51bc8e0196bb12366df /lib/api
parent322913f331dddc811760f7d42201974b02aa9f5e (diff)
parent41b08e4a08b8caf445d2b7b59e2e76b73ab88a7b (diff)
downloadgitlab-ce-d8b71ed83e28666286afc4211e0e6ef603fbfe1b.tar.gz
Merge branch 'master' into flevour/gitlab-ce-fix-merge-request-textareas
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/entities.rb2
-rw-r--r--lib/api/project_hooks.rb6
-rw-r--r--lib/api/users.rb11
3 files changed, 16 insertions, 3 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 33b6224a810..9620d36ac41 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -45,7 +45,7 @@ module API
class ProjectHook < Hook
expose :project_id, :push_events
- expose :issues_events, :merge_requests_events, :tag_push_events
+ expose :issues_events, :merge_requests_events, :tag_push_events, :note_events, :enable_ssl_verification
end
class ForkedFromProject < Grape::Entity
diff --git a/lib/api/project_hooks.rb b/lib/api/project_hooks.rb
index ad4d2e65dfd..882d1a083ad 100644
--- a/lib/api/project_hooks.rb
+++ b/lib/api/project_hooks.rb
@@ -44,7 +44,8 @@ module API
:issues_events,
:merge_requests_events,
:tag_push_events,
- :note_events
+ :note_events,
+ :enable_ssl_verification
]
@hook = user_project.hooks.new(attrs)
@@ -75,7 +76,8 @@ module API
:issues_events,
:merge_requests_events,
:tag_push_events,
- :note_events
+ :note_events,
+ :enable_ssl_verification
]
if @hook.update_attributes attrs
diff --git a/lib/api/users.rb b/lib/api/users.rb
index 813cc379e43..a98d668e02d 100644
--- a/lib/api/users.rb
+++ b/lib/api/users.rb
@@ -121,6 +121,17 @@ module API
User.where(username: attrs[:username]).
where.not(id: user.id).count > 0
+ identity_attrs = attributes_for_keys [:provider, :extern_uid]
+ if identity_attrs.any?
+ identity = user.identities.find_by(provider: identity_attrs[:provider])
+ if identity
+ identity.update_attributes(identity_attrs)
+ else
+ identity = user.identities.build(identity_attrs)
+ identity.save
+ end
+ end
+
if user.update_attributes(attrs)
present user, with: Entities::UserFull
else