]> source.dussan.org Git - redmine.git/commitdiff
Merged r14970 to r14972 (#21477).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 19 Dec 2015 08:01:58 +0000 (08:01 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 19 Dec 2015 08:01:58 +0000 (08:01 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@14980 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue.rb
test/unit/issue_test.rb

index 707c4581c158ec9214d21f9549f8a547895637f0..ba7a9b159e0bd30f7cc8e1691d55c59d942f2fb8 100644 (file)
@@ -810,7 +810,7 @@ class Issue < ActiveRecord::Base
   # Users the issue can be assigned to
   def assignable_users
     users = project.assignable_users.to_a
-    users << author if author
+    users << author if author && author.active?
     users << assigned_to if assigned_to
     users.uniq.sort
   end
index 1dea102a509fd7399c76cb56128c1b3263b06cea..8527554734db10f9fae52eb7e4f9e7f1d1e6c84f 100644 (file)
@@ -1929,6 +1929,20 @@ class IssueTest < ActiveSupport::TestCase
     assert issue.assignable_users.include?(non_project_member)
   end
 
+  def test_assignable_users_should_not_include_anonymous_user
+    issue = Issue.generate!(:author => User.anonymous)
+
+    assert !issue.assignable_users.include?(User.anonymous)
+  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
     user = User.generate!
     issue = Issue.generate!(:assigned_to => user)