Fix registration form
- Admins should be able to change admin status - Username should not be changeable - always require password confirmation
This commit is contained in:
parent
6304466696
commit
7babc5d08a
2 changed files with 18 additions and 22 deletions
|
|
@ -26,14 +26,9 @@ class RegistrationsController < Devise::RegistrationsController
|
|||
end
|
||||
|
||||
def account_update_params
|
||||
params.require(:user).permit(
|
||||
:email,
|
||||
:password,
|
||||
:password_confirmation,
|
||||
:current_password,
|
||||
:username,
|
||||
:email_public
|
||||
)
|
||||
user_attributes = [:email, :name, :password, :password_confirmation, :current_password, :email_public]
|
||||
user_attributes << :is_admin if current_user.is_admin?
|
||||
params.require(:user).permit(user_attributes)
|
||||
end
|
||||
|
||||
def check_captcha
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue