Commit 33c30b1b4b920acdd6cf575e4e4eaa72637bfb13

Authored by Rodrigo Souto
1 parent c3fe8740

[tolerance-time] Fixing expiration logic

plugins/tolerance_time/lib/tolerance_time_plugin.rb
@@ -13,7 +13,8 @@ class ToleranceTimePlugin < Noosfero::Plugin @@ -13,7 +13,8 @@ class ToleranceTimePlugin < Noosfero::Plugin
13 13
14 def self.expired?(content) 14 def self.expired?(content)
15 publication = ToleranceTimePlugin::Publication.find_by_target(content) 15 publication = ToleranceTimePlugin::Publication.find_by_target(content)
16 - (content.kind_of?(Comment) || (!content.folder? && content.published?)) && (!publication.present? || publication.expired?) 16 + (content.kind_of?(Comment) || (!content.folder? && content.published?)) &&
  17 + ((!publication.present? && !content.profile.kind_of?(Person)) || (publication.present? && publication.expired?))
17 end 18 end
18 19
19 def control_panel_buttons 20 def control_panel_buttons