From f47edb1446576b2a3e7efab68383d9be8eb68dd4 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 24 Sep 2012 18:43:30 +0100 Subject: [PATCH] Don't report the PD flag in the user API call --- app/views/user/api_read.builder | 9 ++++++--- test/functional/user_controller_test.rb | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/views/user/api_read.builder b/app/views/user/api_read.builder index d25ff9f64..db7bcc2b7 100644 --- a/app/views/user/api_read.builder +++ b/app/views/user/api_read.builder @@ -6,9 +6,12 @@ xml.osm("version" => API_VERSION, "generator" => GENERATOR) do if @this_user.description xml.tag! "description", @this_user.description end - xml.tag! "contributor-terms", - :agreed => !!@this_user.terms_agreed, - :pd => !!@this_user.consider_pd + if @user && @user == @this_user + xml.tag! "contributor-terms", :agreed => !!@this_user.terms_agreed, + :pd => !!@this_user.consider_pd + else + xml.tag! "contributor-terms", :agreed => !!@this_user.terms_agreed + end if @this_user.image.file? xml.tag! "img", :href => "http://#{SERVER_URL}#{@this_user.image.url}" end diff --git a/test/functional/user_controller_test.rb b/test/functional/user_controller_test.rb index afff1b2a8..606924b35 100644 --- a/test/functional/user_controller_test.rb +++ b/test/functional/user_controller_test.rb @@ -531,6 +531,7 @@ class UserControllerTest < ActionController::TestCase assert_response :success # check that we aren't revealing private information + assert_select "contributor-terms[pd]", false assert_select "home", false assert_select "languages", false -- 2.43.2