Merge pull request #5514 from AntonKhorev/pd-declaration

Remove public domain checkbox from signup and terms pages
This commit is contained in:
Andy Allan 2025-02-15 14:03:55 +00:00 committed by GitHub
commit aebacc88de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 222 additions and 66 deletions

View file

@ -0,0 +1,28 @@
module Accounts
class PdDeclarationsController < ApplicationController
layout "site"
before_action :authorize_web
before_action :set_locale
authorize_resource :class => :account_pd_declaration
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
end

View file

@ -33,7 +33,6 @@ module Accounts
flash[:notice] = { :partial => "accounts/terms/terms_declined_flash" } if current_user.save
else
unless current_user.terms_agreed?
current_user.consider_pd = params[:user][:consider_pd]
current_user.tou_agreed = Time.now.utc
current_user.terms_agreed = Time.now.utc
current_user.terms_seen = true

View file

@ -222,8 +222,7 @@ class UsersController < ApplicationController
def user_params
params.require(:user).permit(:email, :display_name,
:auth_provider, :auth_uid,
:pass_crypt, :pass_crypt_confirmation,
:consider_pd)
:pass_crypt, :pass_crypt_confirmation)
end
##