Adds error message to mastodon:confirm_email task. (#1476)
parent
68f3ce7d0c
commit
317777ec80
|
@ -13,10 +13,13 @@ namespace :mastodon do
|
||||||
desc 'Manually confirms a user with associated user email address stored in USER_EMAIL environment variable.'
|
desc 'Manually confirms a user with associated user email address stored in USER_EMAIL environment variable.'
|
||||||
task confirm_email: :environment do
|
task confirm_email: :environment do
|
||||||
email = ENV.fetch('USER_EMAIL')
|
email = ENV.fetch('USER_EMAIL')
|
||||||
user = User.where(email: email)
|
user = User.where(email: email).first
|
||||||
user.update(confirmed_at: Time.now.utc)
|
if user
|
||||||
|
user.update(confirmed_at: Time.now.utc)
|
||||||
puts "User #{email} confirmed."
|
puts "User #{email} confirmed."
|
||||||
|
else
|
||||||
|
abort "User #{email} not found."
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
namespace :media do
|
namespace :media do
|
||||||
|
|
Loading…
Reference in New Issue