This commit is contained in:
BoHung Chiu 2022-11-25 00:14:51 +08:00
parent 15800258da
commit a84765e4df
1 changed files with 2 additions and 1 deletions

View File

@ -578,6 +578,7 @@ class EventNewsModsController < ApplicationController
event_news = EventNews.can_display_and_sorted.where(:uid => uid).first event_news = EventNews.can_display_and_sorted.where(:uid => uid).first
end end
event_news = EventNews.where(:uid => uid).first if event_news.nil? event_news = EventNews.where(:uid => uid).first if event_news.nil?
return nil if event_news.nil?
url_to_edit = OrbitHelper.user_can_edit?(event_news) ? "/admin/event_news/#{event_news.id.to_s}/edit" : "" url_to_edit = OrbitHelper.user_can_edit?(event_news) ? "/admin/event_news/#{event_news.id.to_s}/edit" : ""
access_level = OrbitHelper.user_access_level? access_level = OrbitHelper.user_access_level?
@ -671,7 +672,7 @@ class EventNewsModsController < ApplicationController
event_news = OrbitHelper.get_from_feed(uid) event_news = OrbitHelper.get_from_feed(uid)
locale = OrbitHelper.get_site_locale.to_s locale = OrbitHelper.get_site_locale.to_s
url_to_edit = "#" url_to_edit = "#"
return {} if event_news.blank? return nil if event_news.blank?
tags = [] tags = []
event_news["tags"].each{|tag| event_news["tags"].each{|tag|