X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7d6ac34fbcc86f9750ea4590043f12e24b76d057..3cfb8b7d053edfba454dbcb1eff09382b5dca193:/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..4a636a888 100644 --- a/app/controllers/accounts/pd_declarations_controller.rb +++ b/app/controllers/accounts/pd_declarations_controller.rb @@ -10,7 +10,19 @@ module Accounts def show; end def create - redirect_to edit_account_path + 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 account_path end end end