Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
847ca9d5
Commit
847ca9d5
authored
Feb 27, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve conflicts in app/services/members/destroy_service.rb
parent
7548c9aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
48 deletions
+0
-48
app/services/members/destroy_service.rb
app/services/members/destroy_service.rb
+0
-48
No files found.
app/services/members/destroy_service.rb
View file @
847ca9d5
module
Members
class
DestroyService
<
Members
::
BaseService
<<<<<<<
HEAD
prepend
EE
::
Members
::
DestroyService
def
execute
(
member
,
skip_authorization:
false
)
...
...
@@ -12,17 +11,6 @@ module Members
unassign_issues_and_merge_requests
(
member
)
unless
member
.
invite?
member
.
notification_setting
&
.
destroy
=======
def
execute
(
member
,
skip_authorization:
false
)
raise
Gitlab
::
Access
::
AccessDeniedError
unless
skip_authorization
||
can_destroy_member?
(
member
)
return
member
if
member
.
is_a?
(
GroupMember
)
&&
member
.
source
.
last_owner?
(
member
.
user
)
Member
.
transaction
do
unassign_issues_and_merge_requests
(
member
)
unless
member
.
invite?
member
.
notification_setting
&
.
destroy
>>>>>>>
upstream
/
master
member
.
destroy
end
...
...
@@ -49,43 +37,7 @@ module Members
:destroy_project_member
else
raise
"Unknown member type:
#{
member
}
!"
<<<<<<<
HEAD
end
end
def
unassign_issues_and_merge_requests
(
member
)
if
member
.
is_a?
(
GroupMember
)
issues
=
Issue
.
unscoped
.
select
(
1
)
.
joins
(
:project
)
.
where
(
'issues.id = issue_assignees.issue_id AND projects.namespace_id = ?'
,
member
.
source_id
)
# DELETE FROM issue_assignees WHERE user_id = X AND EXISTS (...)
IssueAssignee
.
unscoped
.
where
(
'user_id = :user_id AND EXISTS (:sub)'
,
user_id:
member
.
user_id
,
sub:
issues
)
.
delete_all
MergeRequestsFinder
.
new
(
current_user
,
group_id:
member
.
source_id
,
assignee_id:
member
.
user_id
)
.
execute
.
update_all
(
assignee_id:
nil
)
else
project
=
member
.
source
# SELECT 1 FROM issues WHERE issues.id = issue_assignees.issue_id AND issues.project_id = X
issues
=
Issue
.
unscoped
.
select
(
1
)
.
where
(
'issues.id = issue_assignees.issue_id'
)
.
where
(
project_id:
project
.
id
)
# DELETE FROM issue_assignees WHERE user_id = X AND EXISTS (...)
IssueAssignee
.
unscoped
.
where
(
'user_id = :user_id AND EXISTS (:sub)'
,
user_id:
member
.
user_id
,
sub:
issues
)
.
delete_all
project
.
merge_requests
.
opened
.
assigned_to
(
member
.
user
).
update_all
(
assignee_id:
nil
)
=======
>>>>>>>
upstream
/
master
end
member
.
user
.
invalidate_cache_counts
end
def
unassign_issues_and_merge_requests
(
member
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment