1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

Don't include locked user in assignable users (#21477).

git-svn-id: http://svn.redmine.org/redmine/trunk@14972 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2015-12-12 12:37:56 +00:00
parent b095389a60
commit a5fd84f00e
2 changed files with 9 additions and 1 deletions

View File

@ -810,7 +810,7 @@ class Issue < ActiveRecord::Base
# Users the issue can be assigned to # Users the issue can be assigned to
def assignable_users def assignable_users
users = project.assignable_users.to_a users = project.assignable_users.to_a
users << author if (author && !author.anonymous?) users << author if author && author.active?
users << assigned_to if assigned_to users << assigned_to if assigned_to
users.uniq.sort users.uniq.sort
end end

View File

@ -1935,6 +1935,14 @@ class IssueTest < ActiveSupport::TestCase
assert !issue.assignable_users.include?(User.anonymous) assert !issue.assignable_users.include?(User.anonymous)
end end
def test_assignable_users_should_not_include_locked_user
user = User.generate!
issue = Issue.generate!(:author => user)
user.lock!
assert !issue.assignable_users.include?(user)
end
test "#assignable_users should include the current assignee" do test "#assignable_users should include the current assignee" do
user = User.generate! user = User.generate!
issue = Issue.generate!(:assigned_to => user) issue = Issue.generate!(:assigned_to => user)