4
3
Fork 3

Feature: add a rake task that's like register but also accepts password

and produces cleaner output
Dieser Commit ist enthalten in:
Andrew 2017-10-26 23:00:53 -07:00
Ursprung ccc2f608c5
Commit 4234c0ba7b
1 geänderte Dateien mit 22 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -483,6 +483,28 @@ namespace :mastodon do
end
end
desc 'Machine-readably add a user by providing their email, username and initial password.' \
'The user will receive a confirmation email.'
task add_user_automatic: :environment do
print 'Enter email: '
email = STDIN.gets.chomp
print 'Enter username: '
username = STDIN.gets.chomp
print 'Enter password: '
password = STDIN.gets.chomp
user = User.new(email: email, password: password, account_attributes: { username: username })
if user.save
puts 'User added and confirmation mail sent to user\'s email address.'
else
user.errors.each do |key, val|
STDERR.puts "#{key}: #{val}"
end
end
end
namespace :media do
desc 'Remove media attachments attributed to silenced accounts'
task remove_silenced: :environment do