diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-02 15:11:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-02 15:11:04 +0300 |
commit | ed509186782d16d2bbcb34ac73303e8cb3a9d5a2 (patch) | |
tree | 4ab3bbb33b37e9e4c0f73627617ea6b0c7d0d7f7 /app/models/members | |
parent | 44837830832a41a6fe6360aca18e50826c723fd1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/members')
-rw-r--r-- | app/models/members/member_task.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/members/member_task.rb b/app/models/members/member_task.rb index f093619ff36..6cf6b1adb45 100644 --- a/app/models/members/member_task.rb +++ b/app/models/members/member_task.rb @@ -34,9 +34,10 @@ class MemberTask < ApplicationRecord end def project_in_member_source - if member.is_a?(GroupMember) + case member + when GroupMember errors.add(:project, _('is not in the member group')) unless project.namespace == member.source - elsif member.is_a?(ProjectMember) + when ProjectMember errors.add(:project, _('is not the member project')) unless project == member.source end end |