X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7d6ac34fbcc86f9750ea4590043f12e24b76d057..de4c09cbfd0511a0fc927921b84ac4b649fb69fa:/app/controllers/accounts/pd_declarations_controller.rb diff --git a/app/controllers/accounts/pd_declarations_controller.rb b/app/controllers/accounts/pd_declarations_controller.rb index f6740f777..2d2569d62 100644 --- a/app/controllers/accounts/pd_declarations_controller.rb +++ b/app/controllers/accounts/pd_declarations_controller.rb @@ -10,6 +10,18 @@ module Accounts def show; end def create + if current_user.consider_pd + flash[:warning] = t(".already_declared") + else + current_user.consider_pd = params[:consider_pd] + + if current_user.consider_pd + flash[:notice] = t(".successfully_declared") if current_user.save + else + flash[:warning] = t(".did_not_confirm") + end + end + redirect_to edit_account_path end end