Skip to content
代码片段 群组 项目
未验证 提交 d3c3f5b9 编辑于 作者: Mohamed Hamda's avatar Mohamed Hamda 提交者: GitLab
浏览文件

Merge branch 'vij-adjust-sam-destroyed-worker' into 'master'

Only remove SeatAssignment if no other membership

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/173699



Merged-by: default avatarMohamed Hamda <mhamda@gitlab.com>
Approved-by: default avatarBishwa Hang Rai <bhrai@gitlab.com>
Approved-by: default avatarMohamed Hamda <mhamda@gitlab.com>
Reviewed-by: default avatarVijay Hawoldar <vhawoldar@gitlab.com>
Reviewed-by: default avatarBishwa Hang Rai <bhrai@gitlab.com>
Reviewed-by: default avatarMohamed Hamda <mhamda@gitlab.com>
Co-authored-by: default avatarVijay Hawoldar <vhawoldar@gitlab.com>
No related branches found
No related tags found
无相关合并请求
...@@ -17,7 +17,7 @@ def handle_event(event) ...@@ -17,7 +17,7 @@ def handle_event(event)
return unless user && namespace&.group_namespace? return unless user && namespace&.group_namespace?
return if namespace.billed_project_user?(user) || namespace.billed_group_user?(user) return if ::Member.in_hierarchy(namespace).with_user(user).exists?
GitlabSubscriptions::SeatAssignment.find_by_namespace_and_user(namespace, user)&.destroy GitlabSubscriptions::SeatAssignment.find_by_namespace_and_user(namespace, user)&.destroy
end end
......
...@@ -89,17 +89,25 @@ ...@@ -89,17 +89,25 @@
it_behaves_like 'returns early' it_behaves_like 'returns early'
end end
context 'when user is still billed member of group hierarchy' do context 'when user is still a member of group hierarchy' do
let(:another_sub_group) { create(:group, parent: root_namespace) } let(:another_sub_group) { create(:group, parent: root_namespace) }
before do before do
another_sub_group.add_developer(user) another_sub_group.add_guest(user)
end end
it_behaves_like 'returns early' it_behaves_like 'returns early'
context 'when the user is blocked' do
before do
user.block!
end
it_behaves_like 'returns early'
end
end end
context 'when user is still billed member of project hierarchy' do context 'when user is still a member of project hierarchy' do
let(:project) { build(:project, group: root_namespace) } let(:project) { build(:project, group: root_namespace) }
before do before do
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册