mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Remove action buttons if post has already been reviewed (#20126)
* FIX: Remove action buttons if post has already been reviewed * Change the approve to reject test to expect an error * Adds a controller spec to ensure you can't edit a non-pending review item * Remove unnessary conditional
This commit is contained in:
@@ -32,7 +32,7 @@ class ReviewableQueuedPost < Reviewable
|
||||
end
|
||||
end
|
||||
|
||||
unless rejected?
|
||||
if pending?
|
||||
actions.add(:reject_post) do |a|
|
||||
a.icon = "times"
|
||||
a.label = "reviewables.actions.reject_post.title"
|
||||
@@ -45,17 +45,19 @@ class ReviewableQueuedPost < Reviewable
|
||||
end
|
||||
|
||||
def build_editable_fields(fields, guardian, args)
|
||||
# We can edit category / title if it's a new topic
|
||||
if topic_id.blank?
|
||||
# Only staff can edit category for now, since in theory a category group reviewer could
|
||||
# post in a category they don't have access to.
|
||||
fields.add("category_id", :category) if guardian.is_staff?
|
||||
if pending?
|
||||
# We can edit category / title if it's a new topic
|
||||
if topic_id.blank?
|
||||
# Only staff can edit category for now, since in theory a category group reviewer could
|
||||
# post in a category they don't have access to.
|
||||
fields.add("category_id", :category) if guardian.is_staff?
|
||||
|
||||
fields.add("payload.title", :text)
|
||||
fields.add("payload.tags", :tags)
|
||||
fields.add("payload.title", :text)
|
||||
fields.add("payload.tags", :tags)
|
||||
end
|
||||
|
||||
fields.add("payload.raw", :editor)
|
||||
end
|
||||
|
||||
fields.add("payload.raw", :editor)
|
||||
end
|
||||
|
||||
def create_options
|
||||
|
||||
Reference in New Issue
Block a user