summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-11 18:15:18 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-11 18:15:18 +0300
commit993af5d0d2d596040195c4109c531c33deeac026 (patch)
tree23762152264492821c01c9124802d9d6c4384d11 /lib
parent5511a731bcc05034abacd4ec01ff7d5a2a3b89d3 (diff)
downloadgitlab-ce-993af5d0d2d596040195c4109c531c33deeac026.tar.gz
cattr_accessor is not threadsafe!
Diffstat (limited to 'lib')
-rw-r--r--lib/api/issues.rb3
-rw-r--r--lib/api/merge_requests.rb3
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb
index a2983e197e7..a15203d1563 100644
--- a/lib/api/issues.rb
+++ b/lib/api/issues.rb
@@ -2,6 +2,7 @@ module API
# Issues API
class Issues < Grape::API
before { authenticate! }
+ before { Thread.current[:current_user] = current_user }
resource :issues do
# Get currently authenticated user's issues
@@ -79,7 +80,7 @@ module API
attrs = attributes_for_keys [:title, :description, :assignee_id, :milestone_id, :state_event]
attrs[:label_list] = params[:labels] if params[:labels].present?
- IssueObserver.current_user = current_user
+
if @issue.update_attributes attrs
present @issue, with: Entities::Issue
else
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb
index 23e2f82889f..861a4f4d159 100644
--- a/lib/api/merge_requests.rb
+++ b/lib/api/merge_requests.rb
@@ -2,6 +2,7 @@ module API
# MergeRequest API
class MergeRequests < Grape::API
before { authenticate! }
+ before { Thread.current[:current_user] = current_user }
resource :projects do
helpers do
@@ -94,8 +95,6 @@ module API
authorize! :modify_merge_request, merge_request
- MergeRequestObserver.current_user = current_user
-
if merge_request.update_attributes attrs
merge_request.reload_code
merge_request.mark_as_unchecked