Fix bug where an rejected announcement could still be edited by url

This commit is contained in:
Christophe Vilayphiou 2012-04-24 00:58:56 +08:00
parent 6130f8b1e4
commit db1b84e962
1 changed files with 10 additions and 6 deletions

View File

@ -89,6 +89,9 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
# GET /bulletins/1/edit # GET /bulletins/1/edit
def edit def edit
@bulletin = Bulletin.find(params[:id]) @bulletin = Bulletin.find(params[:id])
if @bulletin.is_rejected?
redirect_to :action => :index
else
# @summary_variable = @bulletin.summary_variable # @summary_variable = @bulletin.summary_variable
@link_url = panel_announcement_back_end_bulletin_path(@bulletin) @link_url = panel_announcement_back_end_bulletin_path(@bulletin)
@ -96,6 +99,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
get_categorys get_categorys
get_tags get_tags
end end
end
# POST /bulletins # POST /bulletins
# POST /bulletins.xml # POST /bulletins.xml