Skip to content

Commit

Permalink
Adds error message to mastodon:confirm_email task. (mastodon#1476)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashfurrow authored and wxcafe committed Apr 10, 2017
1 parent 2810013 commit d439855
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/tasks/mastodon.rake
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ namespace :mastodon do
desc 'Manually confirms a user with associated user email address stored in USER_EMAIL environment variable.'
task confirm_email: :environment do
email = ENV.fetch('USER_EMAIL')
user = User.where(email: email)
user.update(confirmed_at: Time.now.utc)

puts "User #{email} confirmed."
user = User.where(email: email).first
if user
user.update(confirmed_at: Time.now.utc)
puts "User #{email} confirmed."
else
abort "User #{email} not found."
end
end

namespace :media do
Expand Down

0 comments on commit d439855

Please sign in to comment.