Fix auth_users bug without category in news

This commit is contained in:
Christophe Vilayphiou 2012-08-01 03:07:23 +08:00
parent f092aff9e9
commit 625801c0e9
1 changed files with 2 additions and 2 deletions

View File

@ -1,13 +1,13 @@
module Panel::News::BackEnd::NewsBulletinsHelper
def news_show_form_status_field(news_bulletin)
by_news_bulletin = (!news_bulletin.is_expired? and news_bulletin.is_pending?)
by_user = (news_bulletin.news_bulletin_category.authed_users('fact_check').include?(current_user) or is_manager? or is_admin?)
by_user = ((news_bulletin.news_bulletin_category.authed_users('fact_check').include?(current_user) rescue nil) or is_manager? or is_admin?)
by_news_bulletin and by_user
end
def news_show_approval_link(news_bulletin)
by_news_bulletin = (!news_bulletin.is_expired? and news_bulletin.is_pending?)
by_user = (news_bulletin.news_bulletin_category.authed_users('fact_check').include?(current_user) or is_manager? or is_admin?)
by_user = ((news_bulletin.news_bulletin_category.authed_users('fact_check').include?(current_user) rescue nil) or is_manager? or is_admin?)
by_news_bulletin and by_user
end