Skip to content
Snippets Groups Projects
Unverified Commit faf657d7 authored by Daniel M Brasil's avatar Daniel M Brasil Committed by GitHub
Browse files

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

parent c62604b5
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment