Fix time entry user is shown twice in the User drop-down (#33341).

Patch by Thomas Löber and Marius BALTEANU.


git-svn-id: http://svn.redmine.org/redmine/trunk@19727 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2020-04-27 06:19:26 +00:00
parent ee46c3570e
commit 953fce3c95
2 changed files with 2 additions and 2 deletions

View File

@@ -44,7 +44,7 @@ module TimelogHelper
def user_collection_for_select_options(time_entry) def user_collection_for_select_options(time_entry)
collection = time_entry.assignable_users collection = time_entry.assignable_users
collection << time_entry.user unless time_entry.user.nil? && !collection.include?(time_entry.user) collection << time_entry.user if time_entry.user && !collection.include?(time_entry.user)
principals_options_for_select(collection, time_entry.user_id.to_s) principals_options_for_select(collection, time_entry.user_id.to_s)
end end

View File

@@ -226,7 +226,7 @@ class TimelogControllerTest < Redmine::ControllerTest
assert_response :success assert_response :success
assert_select 'select[name=?]', 'time_entry[user_id]' do assert_select 'select[name=?]', 'time_entry[user_id]' do
assert_select 'option[value="2"][selected=selected]' assert_select 'option[value="2"][selected=selected]', 1
end end
end end