mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-04 03:25:14 +00:00
Use attribute for User#bypass_registration_checks? (#35580)
This commit is contained in:
parent
25add0af31
commit
8896d6c1b1
1 changed files with 2 additions and 5 deletions
|
|
@ -132,9 +132,10 @@ class User < ApplicationRecord
|
|||
delegate :can?, to: :role
|
||||
|
||||
attr_reader :invite_code, :date_of_birth
|
||||
attr_writer :bypass_registration_checks, :current_account
|
||||
attr_writer :current_account
|
||||
|
||||
attribute :external, :boolean, default: false
|
||||
attribute :bypass_registration_checks, :boolean, default: false
|
||||
|
||||
def self.those_who_can(*any_of_privileges)
|
||||
matching_role_ids = UserRole.that_can(*any_of_privileges).map(&:id)
|
||||
|
|
@ -477,10 +478,6 @@ class User < ApplicationRecord
|
|||
Setting.registrations_mode == 'open'
|
||||
end
|
||||
|
||||
def bypass_registration_checks?
|
||||
@bypass_registration_checks
|
||||
end
|
||||
|
||||
def sanitize_role
|
||||
self.role = nil if role.present? && role.everyone?
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue