Skip to content

Commit

Permalink
Add ability to set approval-based registration through tootctl (masto…
Browse files Browse the repository at this point in the history
…don#18248)

Fixes mastodon#18235

Add `tootctl settings registrations approved` with
optional `--require-reason` switch.
  • Loading branch information
ClearlyClaire authored and single-right-quote committed May 5, 2022
1 parent 1f17f29 commit a97c5f8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/mastodon/settings_cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ def open
say('OK', :green)
end

desc 'approved', 'Open approval-based registrations'
option :require_reason, type: :boolean, aliases: [:require_invite_text]
long_desc <<~LONG_DESC
Set registrations to require review from staff.
With --require-reason, require users to enter a reason when registering,
otherwise this field is optional.
LONG_DESC
def approved
Setting.registrations_mode = 'approved'
Setting.require_invite_text = options[:require_reason] unless options[:require_reason].nil?
say('OK', :green)
end

desc 'close', 'Close registrations'
def close
Setting.registrations_mode = 'none'
Expand Down

0 comments on commit a97c5f8

Please sign in to comment.