allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [18/43] git commit: [#4905] don't show subscribe button to anonymous visitors
Date Thu, 18 Sep 2014 07:29:53 GMT
[#4905] don't show subscribe button to anonymous visitors


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/ceb0d22b
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/ceb0d22b
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/ceb0d22b

Branch: refs/heads/je/42cc_7656
Commit: ceb0d22b3a89bff1589fa08a4278cc3e7bcee495
Parents: a96d81b
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Wed Sep 17 15:50:19 2014 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Sep 17 15:50:19 2014 +0000

----------------------------------------------------------------------
 ForgeWiki/forgewiki/wiki_main.py | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/ceb0d22b/ForgeWiki/forgewiki/wiki_main.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/wiki_main.py b/ForgeWiki/forgewiki/wiki_main.py
index f0169a4..e32a741 100644
--- a/ForgeWiki/forgewiki/wiki_main.py
+++ b/ForgeWiki/forgewiki/wiki_main.py
@@ -227,14 +227,15 @@ The wiki uses [Markdown](%s) syntax.
                 SitemapEntry(
                     'Moderate', discussion.url() + 'moderate', ui_icon=g.icons['pencil'],
                     small=pending_mod_count))
-        subscribed = M.Mailbox.subscribed()
-        subscribe_action = 'unsubscribe' if subscribed else 'subscribe'
-        subscribe_title = '{}{}'.format(
-            subscribe_action.capitalize(),
-            '' if subscribed else ' to wiki')
-        subscribe_url = '{}subscribe?{}=True'.format(self.url, subscribe_action)
-        links += [SitemapEntry(''),
-                  SitemapEntry(subscribe_title, subscribe_url, ui_icon=g.icons['mail'])]
+        if not c.user.is_anonymous():
+            subscribed = M.Mailbox.subscribed()
+            subscribe_action = 'unsubscribe' if subscribed else 'subscribe'
+            subscribe_title = '{}{}'.format(
+                subscribe_action.capitalize(),
+                '' if subscribed else ' to wiki')
+            subscribe_url = '{}subscribe?{}=True'.format(self.url, subscribe_action)
+            links += [SitemapEntry(''),
+                      SitemapEntry(subscribe_title, subscribe_url, ui_icon=g.icons['mail'])]
         if not admin_menu:
             links += [SitemapEntry(''),
                       SitemapEntry('Formatting Help', self.url + 'markdown_syntax/')]


Mime
View raw message