Compare commits
No commits in common. "a93ae1269b49c6be427406285dacd729e7a80ff0" and "9483882acfb202bc7f81d6def12776d996435bf7" have entirely different histories.
a93ae1269b
...
9483882acf
1 changed files with 3 additions and 3 deletions
6
vedia.rb
6
vedia.rb
|
|
@ -149,7 +149,7 @@ get '/reset' do
|
||||||
end
|
end
|
||||||
|
|
||||||
post '/reset' do
|
post '/reset' do
|
||||||
logger.info "Password reset request for \"#{params[:email]}\""
|
logger.info params[:email]
|
||||||
@errors = []
|
@errors = []
|
||||||
if not params[:email] =~ URI::MailTo::EMAIL_REGEXP
|
if not params[:email] =~ URI::MailTo::EMAIL_REGEXP
|
||||||
@errors << OpenStruct.new(:attribute => :email, :type => :invalid)
|
@errors << OpenStruct.new(:attribute => :email, :type => :invalid)
|
||||||
|
|
@ -562,11 +562,11 @@ end
|
||||||
|
|
||||||
def close_expired_votes
|
def close_expired_votes
|
||||||
Vote.where(state: 'open').where("expire_on < :now", { now: Time.now.utc }).each do |vote|
|
Vote.where(state: 'open').where("expire_on < :now", { now: Time.now.utc }).each do |vote|
|
||||||
puts "#{Time.now.utc} Closing vote \"#{vote.title}\" because it expired on #{vote.expire_on}..."
|
logger.info "#{Time.now.utc} Closing vote \"#{vote.title}\" because it expired on #{vote.expire_on}..."
|
||||||
vote.state = 'closed'
|
vote.state = 'closed'
|
||||||
vote.save
|
vote.save
|
||||||
User.all.each do |user|
|
User.all.each do |user|
|
||||||
puts "#{Time.now.utc} Sending results by email to #{user.email}..."
|
logger.info "#{Time.now.utc} Sending results by email to #{user.email}..."
|
||||||
mail = Mail.new
|
mail = Mail.new
|
||||||
mail.from = settings.admin_email
|
mail.from = settings.admin_email
|
||||||
mail.to = user.email
|
mail.to = user.email
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue