Commit 33c30b1b4b920acdd6cf575e4e4eaa72637bfb13
1 parent
c3fe8740
Exists in
master
and in
28 other branches
[tolerance-time] Fixing expiration logic
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
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 |