Skip to content

Commit

Permalink
Merge pull request #2 from CloCkWeRX/issue-412
Browse files Browse the repository at this point in the history
Added stripping users emails from whitespaces
  • Loading branch information
CloCkWeRX committed Dec 5, 2016
2 parents 6d8e508 + ceb8a6e commit 7db549a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/admin/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def edit
# POST /admin/users.xml AJAX
#----------------------------------------------------------------------------
def create
params[:user][:email].try(:strip!)
params[:user][:password_confirmation] = nil if params[:user][:password_confirmation].blank?
@user = User.new(user_params)
@user.save_without_session_maintenance
Expand All @@ -55,6 +56,7 @@ def create
# PUT /admin/users/1.xml AJAX
#----------------------------------------------------------------------------
def update
params[:user][:email].try(:strip!)
params[:user][:password_confirmation] = nil if params[:user][:password_confirmation].blank?
@user = User.find(params[:id])
@user.attributes = user_params
Expand Down
1 change: 1 addition & 0 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def opportunities_overview
protected

def user_params
params[:user][:email].try(:strip!)
params[:user].permit(
:username,
:email,
Expand Down

0 comments on commit 7db549a

Please sign in to comment.