From 91b6459f2b96cd8cab79b87317e589fb92595759 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 30 May 2014 14:37:12 +1000 Subject: [PATCH] BUGFIX: allow users to pick no avatar --- app/controllers/users_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 5a2c34c0e84..9f9c907b97b 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -365,7 +365,6 @@ class UsersController < ApplicationController end def pick_avatar - params.require(:upload_id) user = fetch_user_from_params guardian.ensure_can_edit!(user) upload_id = params[:upload_id] @@ -373,7 +372,7 @@ class UsersController < ApplicationController user.uploaded_avatar_id = upload_id # ensure we associate the custom avatar properly - unless user.user_avatar.contains_upload?(upload_id) + if upload_id && !user.user_avatar.contains_upload?(upload_id) user.user_avatar.custom_upload_id = upload_id end user.save!