Fix #4177: Allow all users to change their username.

This commit is contained in:
evazion
2019-09-25 21:16:19 -05:00
parent 3b63f94968
commit c710aa3ffb
5 changed files with 3 additions and 21 deletions

View File

@@ -1,6 +1,5 @@
class UserNameChangeRequestsController < ApplicationController
before_action :member_only, :only => [:index, :show]
before_action :gold_only, :only => [:new, :create]
before_action :member_only, :only => [:index, :show, :new, :create]
respond_to :html, :json, :xml
def new

View File

@@ -86,12 +86,6 @@
<td>Yes</td>
<td>Yes</td>
</tr>
<tr>
<td>Name Changes</td>
<td>No</td>
<td>Yes</td>
<td>Yes</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -11,12 +11,7 @@
<fieldset id="basic-settings-section">
<div class="input">
<label>Name</label>
<% if CurrentUser.user.is_gold? %>
<p><%= link_to "Change your name", new_user_name_change_request_path %></p>
<% else %>
<p>You must <%= link_to "upgrade your account", new_user_upgrade_path %> to request a name change</p>
<% end %>
<p><%= link_to "Change your name", new_user_name_change_request_path %></p>
</div>
<div class="input">

View File

@@ -7,12 +7,6 @@
comments. If you want <%= link_to "more features", new_user_upgrade_path %> you can upgrade your account later.
</p>
<p>
<strong>This site is open to web crawlers, so whatever name you choose will be public</strong>. This includes
favorites, uploads, and comments. Almost everything is public. So don't choose a name you don't want to be
associated with.
</p>
<div id="p3">
<%= simple_form_for(@user, html: {id: "signup-form"}) do |f| %>
<%= f.input :name, as: :string %>

View File

@@ -3,7 +3,7 @@ require 'test_helper'
class UserNameChangeRequestsControllerTest < ActionDispatch::IntegrationTest
context "The user name change requests controller" do
setup do
@user = create(:gold_user)
@user = create(:member_user)
@admin = create(:admin_user)
end