0
0
Fork 0

Admission-based registrations mode (#10250)

Fix #6856
Fix #6951
This commit is contained in:
Eugen Rochko 2019-03-14 05:28:30 +01:00 committed by GitHub
parent 6e3936aa6f
commit 51e154f5e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
92 changed files with 282 additions and 249 deletions

View file

@ -7,16 +7,18 @@ module AccountControllerConcern
included do
layout 'public'
before_action :set_account
before_action :check_account_approval
before_action :check_account_suspension
before_action :set_instance_presenter
before_action :set_link_headers
before_action :check_account_suspension
end
private
def set_account
@account = Account.find_local!(params[:account_username])
@account = Account.find_local!(username_param)
end
def set_instance_presenter
@ -33,6 +35,10 @@ module AccountControllerConcern
)
end
def username_param
params[:account_username]
end
def webfinger_account_link
[
webfinger_account_url,
@ -58,6 +64,10 @@ module AccountControllerConcern
webfinger_url(resource: @account.to_webfinger_s)
end
def check_account_approval
not_found if @account.user_pending?
end
def check_account_suspension
gone if @account.suspended?
end