Fix uncaught ActiveRecord::StatementInvalid exception in `Mastodon::AccountsCLI#approve` (#24590)

th-downstream
Daniel M Brasil 2 years ago committed by GitHub
parent 305196d948
commit e9039513a0

@ -543,7 +543,7 @@ module Mastodon
if options[:all]
User.pending.find_each(&:approve!)
say('OK', :green)
elsif options[:number]
elsif options[:number]&.positive?
User.pending.limit(options[:number]).each(&:approve!)
say('OK', :green)
elsif username.present?
@ -557,6 +557,7 @@ module Mastodon
account.user&.approve!
say('OK', :green)
else
say('Number must be positive', :red) if options[:number]
exit(1)
end
end

Loading…
Cancel
Save