allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [09/12] allura git commit: [#8023] ticket:868 Added check mathing url with page_regex and tool_name with page_tool_type
Date Tue, 15 Dec 2015 14:24:41 GMT
[#8023] ticket:868 Added check mathing url with page_regex and tool_name with page_tool_type


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

Branch: refs/heads/ib/8023b
Commit: 10641731d371f0152e7802777572d2da1f1f9d4f
Parents: b77e21e
Author: Denis Kotov <deniskkotov@gmail.com>
Authored: Fri Dec 4 15:57:21 2015 +0200
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Tue Dec 15 13:43:03 2015 +0200

----------------------------------------------------------------------
 Allura/allura/lib/plugin.py | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/10641731/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index 2daf8ee..43cc98f 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -1324,6 +1324,14 @@ class ThemeProvider(object):
                 only_user_project = projects.count() == 1 and projects.first().is_user_project
                 if projects.count() == 0 or only_user_project:
                     return None
+        tool_matching = False
+        url_matching = False
+        if note.page_tool_type is None or c.app is not None and c.app.config.tool_name.lower()
== note.page_tool_type.lower():
+            tool_matching = True
+        if note.page_regex is None or re.search(note.page_regex, request.url):
+            tool_matching = True
+        if not tool_matching and not url_matching:
+            return None
         cookie = request.cookies.get('site-notification', '').split('-')
         if len(cookie) == 3 and cookie[0] == str(note._id):
             views = asint(cookie[1]) + 1


Mime
View raw message