Fix announcement create error.
This commit is contained in:
parent
2579c02663
commit
58b5f5509c
|
@ -191,6 +191,7 @@ class Admin::AnnouncementsController < OrbitAdminController
|
|||
|
||||
def create
|
||||
bps = bulletin_params
|
||||
bulletin = Bulletin.new(bps)
|
||||
if !bps['bulletin_links_attributes'].nil?
|
||||
bps['bulletin_links_attributes'].each do |idx,link|
|
||||
bps['bulletin_links_attributes'].delete(idx.to_s) if link['url'].blank?
|
||||
|
@ -207,7 +208,6 @@ class Admin::AnnouncementsController < OrbitAdminController
|
|||
bps[:is_hidden] = false
|
||||
end
|
||||
|
||||
bulletin = Bulletin.new(bps)
|
||||
if !defined?(Calendar).nil?
|
||||
if bps[:add_to_calendar] == '0' && !bps[:event_id].blank?
|
||||
Event.find(bps[:event_id]).destroy rescue nil
|
||||
|
|
Loading…
Reference in New Issue