Skip to content
Snippets Groups Projects
Commit fcffb4c3 authored by Jaakko Kantojärvi's avatar Jaakko Kantojärvi
Browse files

Move username change decision into user model

parent de7012c4
No related branches found
No related tags found
3 merge requests!3014Fix 4.1 Installation Doc wording,!2983Fixed typo in gitlab.yml.example,!2888Add option to disable username changing
Loading
Loading
@@ -51,7 +51,7 @@ class ProfilesController < ApplicationController
end
 
def update_username
if Gitlab.config.gitlab.username_changing_enabled
if @user.can_change_username?
@user.update_attributes(username: params[:user][:username])
end
 
Loading
Loading
Loading
Loading
@@ -215,6 +215,10 @@ class User < ActiveRecord::Base
keys.count == 0
end
 
def can_change_username?
Gitlab.config.gitlab.username_changing_enabled
end
def can_create_project?
projects_limit > personal_projects.count
end
Loading
Loading
Loading
Loading
@@ -53,7 +53,7 @@
 
 
 
- if Gitlab.config.gitlab.username_changing_enabled
- if current_user.can_change_username?
%fieldset.update-username
%legend
Username
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment