Fix uncaught ActiveRecord::StatementInvalid exception in `Mastodon::AccountsCLI#approve` (#24590)
This commit is contained in:
parent
c62604b5f6
commit
faf657d709
|
@ -543,7 +543,7 @@ module Mastodon
|
||||||
if options[:all]
|
if options[:all]
|
||||||
User.pending.find_each(&:approve!)
|
User.pending.find_each(&:approve!)
|
||||||
say('OK', :green)
|
say('OK', :green)
|
||||||
elsif options[:number]
|
elsif options[:number]&.positive?
|
||||||
User.pending.limit(options[:number]).each(&:approve!)
|
User.pending.limit(options[:number]).each(&:approve!)
|
||||||
say('OK', :green)
|
say('OK', :green)
|
||||||
elsif username.present?
|
elsif username.present?
|
||||||
|
@ -557,6 +557,7 @@ module Mastodon
|
||||||
account.user&.approve!
|
account.user&.approve!
|
||||||
say('OK', :green)
|
say('OK', :green)
|
||||||
else
|
else
|
||||||
|
say('Number must be positive', :red) if options[:number]
|
||||||
exit(1)
|
exit(1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Reference in New Issue