* Add: #348 新規登録の上限人数 * Fix test * Fix test * Wip * Fix test * Add invite support * Wip * Fix test * Fix test * Fix test
This commit is contained in:
parent
d7cc6b788c
commit
e317edecb8
26 changed files with 362 additions and 6 deletions
|
@ -15,6 +15,12 @@ class Form::AdminSettings
|
|||
registrations_mode
|
||||
closed_registrations_message
|
||||
registration_button_message
|
||||
registrations_limit
|
||||
registrations_limit_per_day
|
||||
registrations_start_hour
|
||||
registrations_end_hour
|
||||
registrations_secondary_start_hour
|
||||
registrations_secondary_end_hour
|
||||
timeline_preview
|
||||
bootstrap_timeline_accounts
|
||||
theme
|
||||
|
@ -61,6 +67,12 @@ class Form::AdminSettings
|
|||
content_cache_retention_period
|
||||
backups_retention_period
|
||||
post_hash_tags_max
|
||||
registrations_limit
|
||||
registrations_limit_per_day
|
||||
registrations_start_hour
|
||||
registrations_end_hour
|
||||
registrations_secondary_start_hour
|
||||
registrations_secondary_end_hour
|
||||
).freeze
|
||||
|
||||
BOOLEAN_KEYS = %i(
|
||||
|
|
|
@ -55,6 +55,7 @@ class User < ApplicationRecord
|
|||
|
||||
include LanguagesHelper
|
||||
include Redisable
|
||||
include RegistrationLimitationHelper
|
||||
include User::HasSettings
|
||||
include User::LdapAuthenticable
|
||||
include User::Omniauthable
|
||||
|
@ -192,6 +193,8 @@ class User < ApplicationRecord
|
|||
end
|
||||
|
||||
def confirm
|
||||
raise Mastodon::ValidationError, I18n.t('devise.registrations.sign_up_failed_because_reach_limit') if !invited? && reach_registrations_limit?
|
||||
|
||||
wrap_email_confirmation do
|
||||
super
|
||||
end
|
||||
|
@ -482,6 +485,7 @@ class User < ApplicationRecord
|
|||
ActivityTracker.record('activity:logins', id)
|
||||
UserMailer.welcome(self).deliver_later
|
||||
TriggerWebhookWorker.perform_async('account.approved', 'Account', account_id)
|
||||
reset_registration_limit_caches!
|
||||
end
|
||||
|
||||
def prepare_returning_user!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue