Merge pull request #2853 from evazion/fix-name-change-api

Fix user name change reasons being public in API
This commit is contained in:
Albert Yi
2017-01-20 11:34:31 -08:00
committed by GitHub
2 changed files with 11 additions and 6 deletions

View File

@@ -89,4 +89,12 @@ class UserNameChangeRequest < ActiveRecord::Base
return true return true
end end
end end
def hidden_attributes
if CurrentUser.is_admin? || user == CurrentUser.user
[]
else
super + [:change_reason, :rejection_reason]
end
end
end end

View File

@@ -1,6 +1,8 @@
<h1>Name Change Request</h1> <h1>Name Change Request</h1>
<p>You can request a name change but it must be approved. Factors that go into consideration include your upload and update history, and your user feedback.</p> <p>You can request a name change once per week. Your previous names will still
be visible on your profile to other Danbooru members, but they won't be visible
to search engines.</p>
<%= error_messages_for "change_request" %> <%= error_messages_for "change_request" %>
@@ -10,11 +12,6 @@
<%= text_field_tag "desired_name" %> <%= text_field_tag "desired_name" %>
</div> </div>
<div class="input">
<label for="desired_name">Reason</label>
<%= text_field_tag "reason" %>
</div>
<div class="input"> <div class="input">
<%= submit_tag "Submit", :data => { :disable_with => "Submitting..." } %> <%= submit_tag "Submit", :data => { :disable_with => "Submitting..." } %>
</div> </div>