Fixed Bug for checking presence of email template before sending mails

This commit is contained in:
Gopesh Tulsyan 2014-04-04 15:43:36 +05:30
parent 628211f0fc
commit dd9640b90b

View file

@ -121,6 +121,9 @@ class Admin::EventsController < ApplicationController
def update_state
event = Event.find(params[:id])
if params[:send_mail] == "true" and (event.conference.email_settings.accepted_email_template.nil? or event.conference.email_settings.rejected_email_template.nil?)
redirect_to(admin_conference_events_path(:conference_id => @conference.short_title), :notice => "Update Email Template before Sending Mails") and return
end
event.send(:"#{params[:transition]}!", :send_mail => params[:send_mail])
expire_page :controller => '/schedule', :action => :index
redirect_to(admin_conference_events_path(:conference_id => @conference.short_title), :notice => "Updated state")