[Git][noosfero/noosfero][stable-2.6] Merge branch 'fixes-show-newsletter' into 'master'

Rodrigo Souto gitlab at mg.gitlab.com
Wed Sep 26 15:56:52 BRT 2018


Rodrigo Souto pushed to branch stable-2.6 at Noosfero / noosfero


Commits:
a05c4ca5 by Rodrigo Souto at 2018-09-26T18:56:50Z
Merge branch 'fixes-show-newsletter' into 'master'

Fixes show_newsletter method on public access restriction plugin

See merge request noosfero/noosfero!1615

(cherry picked from commit 0e989101a5770f33f95bd2fd6f2dca2fe4afe27a)

f9e0c5b6 Fixes show_newsletter? method on public access restriction plugin
- - - - -


1 changed file:

- plugins/public_access_restriction/lib/public_access_restriction_plugin.rb


Changes:

=====================================
plugins/public_access_restriction/lib/public_access_restriction_plugin.rb
=====================================
@@ -71,16 +71,7 @@ class PublicAccessRestrictionPlugin < Noosfero::Plugin
   def show_newsletter? environment, profile
     if environment.enabled_plugins.include?("NewsletterPlugin")
       newsletter = NewsletterPlugin::Newsletter.find_by(environment: environment.id)
-      on_newsletter = params['controller'] == 'newsletter_plugin' && params['action'] == 'mailing'
-      on_newsletter_blog = false
-
-      if newsletter
-        on_newsletter_blog = newsletter.blogs.find_by(profile: profile)
-      end
-
-      on_newsletter || on_newsletter_blog
-    else
-      false
+      newsletter.blogs.find_by(profile: profile)
     end
   end
 



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/a05c4ca53adba703387a788b8646bf81834c27cb

-- 
View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/a05c4ca53adba703387a788b8646bf81834c27cb
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20180926/0c92a5cd/attachment.html>


More information about the Noosfero-dev mailing list