Merge remote-tracking branch 'upstream/pull/4190'

This commit is contained in:
Tom Hughes 2023-08-20 18:49:32 +01:00
commit 7054cea48e
2 changed files with 3 additions and 1 deletions

View file

@ -307,7 +307,7 @@ module Api
# user input checking, we don't have any UIDs < 1
raise OSM::APIBadUserInput, "invalid user ID" if user.to_i < 1
u = User.find(user.to_i)
u = User.find_by(:id => user.to_i)
else
u = User.find_by(:display_name => name)
end

View file

@ -1863,8 +1863,10 @@ module Api
# not found when looking for changesets of non-existing users
get changesets_path(:user => User.maximum(:id) + 1)
assert_response :not_found
assert_equal "text/plain", @response.media_type
get changesets_path(:display_name => " ")
assert_response :not_found
assert_equal "text/plain", @response.media_type
# can't get changesets of user 1 without authenticating
get changesets_path(:user => private_user.id)